@Override public void run() { try { HudsonSecurityManager.grantFullControl(); reload(); } catch (IOException e) { logger.error("Failed to reload Hudson config", e); } catch (ReactorException e) { logger.error("Failed to reload Hudson config", e); } catch (InterruptedException e) { logger.error("Failed to reload Hudson config", e); } } }.start();
public final void run() { // background activity gets system credential, // just like executors get it. HudsonSecurityManager.grantFullControl(); try { doRun(); } catch (Throwable t) { LOGGER.log(Level.SEVERE, "Timer task " + this + " failed", t); } finally { HudsonSecurityManager.resetFullControl(); } }
@Override public void run() { try { HudsonSecurityManager.grantFullControl(); // give some time for the browser to load the "reloading" page Thread.sleep(5000); logger.error(String.format("Restarting VM as requested by %s", exitUser)); for (RestartListener listener : RestartListener.all()) { listener.onRestart(); } lifecycle.restart(); } catch (InterruptedException e) { logger.warn("Failed to restart Hudson", e); } catch (IOException e) { logger.warn("Failed to restart Hudson", e); } } }.start();
@Override public void run() { try { HudsonSecurityManager.grantFullControl(); logger.error(String.format("Shutting down VM as requested by %s from %s", exitUser, exitAddr)); // Wait 'til we have no active executors. while (isQuietingDown && (overallLoad.computeTotalExecutors() > overallLoad.computeIdleExecutors())) { Thread.sleep(5000); } // Make sure isQuietingDown is still true. if (isQuietingDown) { cleanUp(); System.exit(0); } } catch (InterruptedException e) { logger.warn("Failed to shutdown Hudson", e); } } }.start();
public void run() { logger.log(Level.INFO, "Started " + name); long startTime = System.currentTimeMillis(); StreamTaskListener l = createListener(); try { HudsonSecurityManager.grantFullControl(); execute(l); } catch (IOException e) { e.printStackTrace(l.fatalError(e.getMessage())); } catch (InterruptedException e) { e.printStackTrace(l.fatalError("aborted")); } finally { l.closeQuietly(); } logger.log(Level.INFO, "Finished " + name + ". " + (System.currentTimeMillis() - startTime) + " ms"); } }, name + " thread");
/** * Sets the thread name to the task for better diagnostics. */ @Override protected void runTask(Task task) throws Exception { if (is != null && is.skipInitTask(task)) { return; } // full access in the initialization thread HudsonSecurityManager.grantFullControl(); String taskName = task.getDisplayName(); Thread t = Thread.currentThread(); String name = t.getName(); if (taskName != null) { t.setName(taskName); } try { long start = System.currentTimeMillis(); super.runTask(task); if (LOG_STARTUP_PERFORMANCE) { logger.info(String.format("Took %dms for %s by %s", System.currentTimeMillis() - start, taskName, name)); } } finally { t.setName(name); HudsonSecurityManager.resetFullControl(); } } };
public void run() { Authentication saveAuth = SecurityContextHolder.getContext().getAuthentication(); HudsonSecurityManager.grantFullControl(); try { Set<AbstractProject> topLevelProjects = new HashSet<AbstractProject>(); // Get all top-level projects LOGGER.fine("assembling top level projects"); for (AbstractProject p : Hudson.getInstance().getAllItems(AbstractProject.class)) { if (p.getUpstreamProjects().size() == 0) { LOGGER.fine("adding top level project " + p.getName()); topLevelProjects.add(p); } else { LOGGER.fine("skipping project since not a top level project: " + p.getName()); } } populate(topLevelProjects); for (AbstractProject p : polledProjects) { LOGGER.fine("running project in correct dependency order: " + p.getName()); runnable.run(p); } } finally { SecurityContextHolder.getContext().setAuthentication(saveAuth); } }
@Override public void run() { try { HudsonSecurityManager.grantFullControl(); // Wait 'til we have no active executors. doQuietDown(true, 0); // Make sure isQuietingDown is still true. if (isQuietingDown) { WebAppController.get().install(new HudsonIsRestarting()); // give some time for the browser to load the "reloading" page logger.info("Restart in 10 seconds"); Thread.sleep(10000); logger.error(String.format("Restarting VM as requested by %s", exitUser)); for (RestartListener listener : RestartListener.all()) { listener.onRestart(); } lifecycle.restart(); } else { logger.info("Safe-restart mode cancelled"); } } catch (InterruptedException e) { logger.warn("Failed to restart Hudson", e); } catch (IOException e) { logger.warn("Failed to restart Hudson", e); } finally { Hudson.this.safeRestarting = false; } } }.start();
@Override public void _run() throws IOException { super._run(); // if this is a bundled plugin, make sure it won't get overwritten PluginWrapper pw = plugin.getInstalled(); if (pw != null && pw.isBundled()) { try { HudsonSecurityManager.grantFullControl(); pw.doPin(); } finally { HudsonSecurityManager.resetFullControl(); } } }
HudsonSecurityManager.grantFullControl(); try {
HudsonSecurityManager.grantFullControl(); try { this.root = root;
@Override public void run() { HudsonSecurityManager.grantFullControl();