jenkins.model.Jenkins.toComputer()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(192)

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

Jenkins.toComputer介绍

暂无

代码示例

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

if (toComputer() == null) {
  future.put("master", RemotingDiagnostics.getThreadDumpAsync(FilePath.localChannel));

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

@Override
public void onRestart() {
  Computer computer = Jenkins.getInstance().toComputer();
  if (computer == null) return;
  RestartCause cause = new RestartCause();
  for (ComputerListener listener: ComputerListener.all()) {
    listener.onOffline(computer, cause);
  }
}

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

final Computer c = toComputer();
if(c != null) {
  for (ComputerListener cl : ComputerListener.all()) {

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

return createFlyWeightTaskRunnable(p, h.toComputer());
} else {
  return null;

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

/**
 * Accepts submission from the node configuration page.
 */
@RequirePOST
public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException {
  checkPermission(ADMINISTER);
  BulkChange bc = new BulkChange(this);
  try {
    JSONObject json = req.getSubmittedForm();
    ExtensionList.lookupSingleton(MasterBuildConfiguration.class).configure(req,json);
    getNodeProperties().rebuild(req, json.optJSONObject("nodeProperties"), NodeProperty.all());
  } finally {
    bc.commit();
  }
  updateComputerList();
  rsp.sendRedirect(req.getContextPath()+'/'+toComputer().getUrl());  // back to the computer page
}

代码示例来源:origin: jenkinsci/azure-vm-agents-plugin

public void resetShutdownVMStatus(final AzureVMAgent agent) {
    Computer computer = Jenkins.getInstance().toComputer();
    if (computer != null
        && System.currentTimeMillis() - computer.getConnectTime() < LAPSE_START_JENKINS) {
      Computer.threadPoolForRemoting.submit(new Runnable() {
        @Override
        public void run() {
          if (agent.getTemplate().isShutdownOnIdle()) {
            agent.setEligibleForReuse(false);
            agent.shutdown(agent.getCleanUpReason());
            agent.blockCleanUpAction();
          }
        }
      });
    }
  }
}

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

if (toComputer() == null) {
  future.put("master", RemotingDiagnostics.getThreadDumpAsync(FilePath.localChannel));

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

@Override
public void onRestart() {
  Computer computer = Jenkins.getInstance().toComputer();
  if (computer == null) return;
  RestartCause cause = new RestartCause();
  for (ComputerListener listener: ComputerListener.all()) {
    listener.onOffline(computer, cause);
  }
}

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

if (forceOnMaster) {
  computer = jenkins.toComputer();
} else {
  computer = Computer.currentComputer();

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

final Computer c = toComputer();
if(c != null) {
  for (ComputerListener cl : ComputerListener.all()) {

代码示例来源:origin: org.jenkins-ci.plugins/git

environment = ((Job) item).getEnvironment(jenkins, TaskListener.NULL);
} else {
  environment = jenkins.toComputer().buildEnvironment(TaskListener.NULL);

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

/**
 * Accepts submission from the node configuration page.
 */
@RequirePOST
public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException {
  checkPermission(ADMINISTER);
  BulkChange bc = new BulkChange(this);
  try {
    JSONObject json = req.getSubmittedForm();
    MasterBuildConfiguration mbc = MasterBuildConfiguration.all().get(MasterBuildConfiguration.class);
    if (mbc!=null)
      mbc.configure(req,json);
    getNodeProperties().rebuild(req, json.optJSONObject("nodeProperties"), NodeProperty.all());
  } finally {
    bc.commit();
  }
  updateComputerList();
  rsp.sendRedirect(req.getContextPath()+'/'+toComputer().getUrl());  // back to the computer page
}

代码示例来源:origin: jenkinsci/workflow-cps-plugin

private void liveness() {
  assertFalse(jenkins().toComputer().isIdle());
  Executor e = b.getOneOffExecutor();
  assertNotNull(e);
  assertEquals(e, b.getExecutor());
  assertTrue(e.isActive());
  /* TODO seems flaky:
  assertFalse(e.isAlive());
  */
}

代码示例来源:origin: org.jenkins-ci.plugins/metrics

if (jenkins.getNumExecutors() > 0) {
  nodeCount++;
  Computer computer = jenkins.toComputer();
  if (computer != null) {
    if (!computer.isOffline()) {

相关文章

Jenkins类方法