hudson.model.Executor.doStop()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(146)

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

Executor.doStop介绍

[英]Stops the current build.
[中]停止当前生成。

代码示例

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

/**
 * @deprecated as of 1.489
 *      Use {@link #doStop()}.
 */
@RequirePOST
@Deprecated
public void doStop( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
  doStop().generateResponse(req,rsp,this);
}

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

/**
 * Stops this build if it's still going.
 *
 * If we use this/executor/stop URL, it causes 404 if the build is already killed,
 * as {@link #getExecutor()} returns null.
 * 
 * @since 1.489
 */
@RequirePOST
public synchronized HttpResponse doStop() throws IOException, ServletException {
  Executor e = getExecutor();
  if (e==null)
    e = getOneOffExecutor();
  if (e!=null)
    return e.doStop();
  else
    // nothing is building
    return HttpResponses.forwardToPreviousPage();
}

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

/**
 * @deprecated as of 1.489
 *      Use {@link #doStop()}.
 */
@RequirePOST
@Deprecated
public void doStop( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
  doStop().generateResponse(req,rsp,this);
}

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

/**
 * Stops this build if it's still going.
 *
 * If we use this/executor/stop URL, it causes 404 if the build is already killed,
 * as {@link #getExecutor()} returns null.
 */
public synchronized void doStop(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
  Executor e = getExecutor();
  if (e!=null)
    e.doStop(req,rsp);
  else
    // nothing is building
    rsp.forwardToPreviousPage(req);
}

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

/**
 * Stops this build if it's still going.
 *
 * If we use this/executor/stop URL, it causes 404 if the build is already killed,
 * as {@link #getExecutor()} returns null.
 */
public synchronized void doStop(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
  Executor e = getExecutor();
  if (e!=null)
    e.doStop(req,rsp);
  else
    // nothing is building
    rsp.forwardToPreviousPage(req);
}

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

/**
 * Stops this build if it's still going.
 *
 * If we use this/executor/stop URL, it causes 404 if the build is already killed,
 * as {@link #getExecutor()} returns null.
 */
public synchronized void doStop(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
  Executor e = getExecutor();
  if (e!=null)
    e.doStop(req,rsp);
  else
    // nothing is building
    rsp.forwardToPreviousPage(req);
}

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

/**
 * Stops this build if it's still going.
 *
 * If we use this/executor/stop URL, it causes 404 if the build is already
 * killed, as {@link #getExecutor()} returns null.
 */
public synchronized void doStop(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
  Executor e = getExecutor();
  if (e != null) {
    e.doStop(req, rsp);
  } else  {
    // nothing is building
    rsp.forwardToPreviousPage(req);
  }
}
private static final Logger LOGGER = Logger.getLogger(AbstractBuild.class.getName());

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

/**
 * Stops this build if it's still going.
 *
 * @return the Http response.
 */
@RequirePOST
public synchronized HttpResponse doStop() throws IOException, ServletException {
  Executor e = Executor.of(this);
  if (e != null) {
    return e.doStop();
  } else {
    // nothing is building
    return HttpResponses.forwardToPreviousPage();
  }
}

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

/**
 * Stops this build if it's still going.
 *
 * @return the Http response.
 */
@RequirePOST
public synchronized HttpResponse doStop() throws IOException, ServletException {
  Executor e = Executor.of(this);
  if (e != null) {
    return e.doStop();
  } else {
    // nothing is building
    return HttpResponses.forwardToPreviousPage();
  }
}

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

@RequirePOST
public synchronized HttpResponse doStop() {
  Executor e = getOneOffExecutor();
  if (e != null) {
    return e.doStop();
  } else {
    doKill();
    return HttpResponses.forwardToPreviousPage();
  }
}

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

/**
 * Stops this build if it's still going.
 *
 * If we use this/executor/stop URL, it causes 404 if the build is already killed,
 * as {@link #getExecutor()} returns null.
 * 
 * @since 1.489
 */
@RequirePOST
public synchronized HttpResponse doStop() throws IOException, ServletException {
  Executor e = getExecutor();
  if (e==null)
    e = getOneOffExecutor();
  if (e!=null)
    return e.doStop();
  else
    // nothing is building
    return HttpResponses.forwardToPreviousPage();
}

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

private void cancelPreviousPullRequestBuilds(Job job, TeamPullRequestMergedDetailsAction pullReqeuestMergedDetails, Queue queue) {
  RunList<?> allBuilds = job.getBuilds();
  for (Run run : allBuilds) {
    TeamPullRequestMergedDetailsAction cause = run.getAction(TeamPullRequestMergedDetailsAction.class);
    if (cause != null && run.isBuilding()) {
      if (cause instanceof TeamPullRequestMergedDetailsAction &&
          cause.gitPullRequest.getPullRequestId() == pullReqeuestMergedDetails.gitPullRequest.getPullRequestId()) {
        LOGGER.info("Canceling previously triggered Job: " + run.getFullDisplayName());
        Executor executor = run.getExecutor();
        if (executor != null)
          executor.doStop();
        Queue.Item item = queue.getItem(run.getQueueId());
        if (item != null)
          queue.cancel(item);
      }
    }
  }
}

代码示例来源:origin: groupon/DotCi

final Executor x = Executor.currentExecutor();
  x.recordCauseOfInterruption(DynamicBuild.this, listener);
  x.doStop();
  return Result.FAILURE;
} finally {

相关文章