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

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

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

Executor.of介绍

[英]Finds the executor currently running a given process.
[中]查找当前正在运行给定进程的执行器。

代码示例

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

/**
 * Gets the {@link Executor} building this job, if it's being built.
 * Otherwise null.
 * 
 * This method looks for {@link Executor} who's {@linkplain Executor#getCurrentExecutable() assigned to this build},
 * and because of that this might not be necessarily in sync with the return value of {@link #isBuilding()} —
 * an executor holds on to {@link Run} some more time even after the build is finished (for example to
 * perform {@linkplain Run.State#POST_PRODUCTION post-production processing}.)
 * @see Executor#of
 */
@Exported 
public @CheckForNull Executor getExecutor() {
  return this instanceof Queue.Executable ? Executor.of((Queue.Executable) this) : null;
}

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

public boolean isBuilding() {
  return Executor.of(this) != null;
}

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

public boolean isBuilding() {
  return Executor.of(this) != null;
}

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

@Restricted(DoNotUse.class) // for Jelly
public @CheckForNull Executor getExecutor() {
  return Executor.of(this);
}

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

@Restricted(DoNotUse.class) // for Jelly
public @CheckForNull Executor getExecutor() {
  return Executor.of(this);
}

代码示例来源:origin: io.jenkins.plugins/docker-slaves

@Restricted(DoNotUse.class) // for Jelly
public @CheckForNull Executor getExecutor() {
  return Executor.of(this);
}

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

/**
 * Gets the {@link Executor} building this job, if it's being built.
 * Otherwise null.
 * 
 * This method looks for {@link Executor} who's {@linkplain Executor#getCurrentExecutable() assigned to this build},
 * and because of that this might not be necessarily in sync with the return value of {@link #isBuilding()} —
 * an executor holds on to {@link Run} some more time even after the build is finished (for example to
 * perform {@linkplain Run.State#POST_PRODUCTION post-production processing}.)
 * @see Executor#of
 */
@Exported 
public @CheckForNull Executor getExecutor() {
  return this instanceof Queue.Executable ? Executor.of((Queue.Executable) this) : null;
}

代码示例来源: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/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: org.jenkins-ci.plugins.workflow/workflow-durable-task-step

Executor e = Executor.of(exec);
if (e != null) {
  LOGGER.log(Level.FINE, "from {0} found {1}", new Object[] {item, e});

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

@Test
@Issue("JENKINS-35112")
public void deleteWhileComputing() throws Exception {
  CoordinatedComputedFolder d = r.jenkins.createProject(CoordinatedComputedFolder.class, "d");
  d.kids.addAll(Arrays.asList("A", "B"));
  QueueTaskFuture<Queue.Executable> future = d.scheduleBuild2(0).getFuture();
  FolderComputation<FreeStyleProject> computation;
  while (Executor.of((computation = d.getComputation())) == null) {
    Thread.sleep(50);
  }
  d.delete();
  assertThat(computation.getResult(), is(Result.ABORTED));
}

相关文章