hudson.model.Hudson.doQuietDown()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中hudson.model.Hudson.doQuietDown()方法的一些代码示例,展示了Hudson.doQuietDown()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hudson.doQuietDown()方法的具体详情如下:
包路径:hudson.model.Hudson
类名称:Hudson
方法名:doQuietDown

Hudson.doQuietDown介绍

暂无

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
 * @deprecated as of 1.317
 *      Use {@link #doQuietDown()} instead.
 */
@Deprecated
@RequirePOST
public synchronized void doQuietDown(StaplerResponse rsp) throws IOException, ServletException {
  doQuietDown().generateResponse(null, rsp, this);
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

public synchronized HttpRedirect doQuietDown() throws IOException {
  try {
    return doQuietDown(false, 0);
  } catch (InterruptedException e) {
    throw new AssertionError(); // impossible
  }
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

public synchronized HttpRedirect doQuietDown() throws IOException {
  try {
    return doQuietDown(false, 0);
  } catch (InterruptedException e) {
    throw new AssertionError(); // impossible
  }
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

public synchronized HttpRedirect doQuietDown() throws IOException {
  try {
    return doQuietDown(false, 0);
  } catch (InterruptedException e) {
    throw new AssertionError(); // impossible
  }
}

代码示例来源:origin: hudson/hudson-2.x

public synchronized HttpRedirect doQuietDown() throws IOException {
  try {
    return doQuietDown(false, 0);
  } catch (InterruptedException e) {
    throw new AssertionError(); // impossible
  }
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * @deprecated as of 1.317 Use {@link #doQuietDown()} instead.
 */
public synchronized void doQuietDown(StaplerResponse rsp) throws IOException, ServletException {
  doQuietDown().generateResponse(null, rsp, this);
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * @deprecated as of 1.317
 *      Use {@link #doQuietDown()} instead.
 */
public synchronized void doQuietDown(StaplerResponse rsp) throws IOException, ServletException {
  doQuietDown().generateResponse(null, rsp, this);
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * @deprecated as of 1.317
 *      Use {@link #doQuietDown()} instead.
 */
public synchronized void doQuietDown(StaplerResponse rsp) throws IOException, ServletException {
  doQuietDown().generateResponse(null, rsp, this);
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * @deprecated as of 1.317
 *      Use {@link #doQuietDown()} instead.
 */
public synchronized void doQuietDown(StaplerResponse rsp) throws IOException, ServletException {
  doQuietDown().generateResponse(null, rsp, this);
}

代码示例来源:origin: org.eclipse.hudson/hudson-service

public void doQuietDown() {
  //securityService.checkPermission(Hudson.ADMINISTER);
  try {
    getHudson().doQuietDown();
  } catch (final IOException e) {
  }
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-service

public void doQuietDown()
{
  //securityService.checkPermission(Hudson.ADMINISTER);
  try{getHudson().doQuietDown();}catch(final IOException e){}
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * @deprecated as of 1.317
 *      Use {@link #doQuietDown()} instead.
 */
@Deprecated
@RequirePOST
public synchronized void doQuietDown(StaplerResponse rsp) throws IOException, ServletException {
  doQuietDown().generateResponse(null, rsp, this);
}

代码示例来源:origin: jenkinsci/thin-backup-plugin

hudson.doQuietDown();

代码示例来源:origin: org.eclipse.hudson/hudson-core

@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();

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

@Override
  public void run() {
    try {
      SecurityContextHolder.getContext().setAuthentication(ACL.SYSTEM);
      // 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.severe(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.log(Level.WARNING, "Failed to restart Hudson", e);
    } catch (IOException e) {
      LOGGER.log(Level.WARNING, "Failed to restart Hudson", e);
    }
  }
}.start();

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

@Override
  public void run() {
    try {
      SecurityContextHolder.getContext().setAuthentication(ACL.SYSTEM);
      // 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.severe(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.log(Level.WARNING, "Failed to restart Hudson", e);
    } catch (IOException e) {
      LOGGER.log(Level.WARNING, "Failed to restart Hudson", e);
    }
  }
}.start();

代码示例来源:origin: hudson/hudson-2.x

@Override
  public void run() {
    try {
      SecurityContextHolder.getContext().setAuthentication(ACL.SYSTEM);
      // 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.severe(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.log(Level.WARNING, "Failed to restart Hudson", e);
    } catch (IOException e) {
      LOGGER.log(Level.WARNING, "Failed to restart Hudson", e);
    }
  }
}.start();

代码示例来源:origin: jenkinsci/thin-backup-plugin

public void doRestore(final StaplerRequest res, final StaplerResponse rsp,
  @QueryParameter("restoreBackupFrom") final String restoreBackupFrom,
  @QueryParameter("restoreNextBuildNumber") final String restoreNextBuildNumber,
  @QueryParameter("restorePlugins") final String restorePlugins) throws IOException {
 LOGGER.info("Starting restore operation.");
 Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
 final Hudson hudson = Hudson.getInstance();
 hudson.doQuietDown();
 LOGGER.fine("Waiting until executors are idle to perform restore...");
 Utils.waitUntilIdle();
 try {
  final File hudsonHome = hudson.getRootDir();
  final Date restoreFromDate = Utils.DISPLAY_DATE_FORMAT.parse(restoreBackupFrom);
  final HudsonRestore hudsonRestore = new HudsonRestore(hudsonHome, ThinBackupPluginImpl.getInstance()
    .getExpandedBackupPath(), restoreFromDate, "on".equals(restoreNextBuildNumber), "on".equals(restorePlugins));
  hudsonRestore.restore();
  LOGGER.info("Restore finished.");
 } catch (ParseException e) {
  LOGGER.severe("Cannot parse restore option. Aborting.");
 } catch (final Exception ise) {
  LOGGER.severe("Could not restore. Aborting.");
 } finally {
  hudson.doCancelQuietDown();
  rsp.sendRedirect(res.getContextPath() + "/thinBackup");
 }
}

相关文章

微信公众号

最新文章

更多

Hudson类方法