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

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

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

Executor.getAsynchronousExecution介绍

[英]If currently running in asynchronous mode, returns that handle.
[中]如果当前以异步模式运行,则返回该句柄。

代码示例

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

/**
 * If this executor is running an {@link AsynchronousExecution} and that execution wants to hide the display
 * cell for the executor (because there is another executor displaying the job progress and we don't want to
 * confuse the user) then this method will return {@code false} to indicate to {@code executors.jelly} that
 * the executor cell should be hidden.
 *
 * @return {@code true} iff the {@code executorCell.jelly} for this {@link Executor} should be displayed in
 *         {@code executors.jelly}.
 * @since 1.607
 * @see AsynchronousExecution#displayCell()
 */
public boolean isDisplayCell() {
  AsynchronousExecution asynchronousExecution = getAsynchronousExecution();
  return asynchronousExecution == null || asynchronousExecution.displayCell();
}

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

private static boolean blocksRestart(Executor e) {
    if (e.isBusy()) {
      AsynchronousExecution execution = e.getAsynchronousExecution();
      if (execution != null) {
        return execution.blocksRestart();
      } else {
        return true;
      }
    } else {
      return false;
    }
  }
}

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

/**
 * If this executor is running an {@link AsynchronousExecution} and that execution wants to hide the display
 * cell for the executor (because there is another executor displaying the job progress and we don't want to
 * confuse the user) then this method will return {@code false} to indicate to {@code executors.jelly} that
 * the executor cell should be hidden.
 *
 * @return {@code true} iff the {@code executorCell.jelly} for this {@link Executor} should be displayed in
 *         {@code executors.jelly}.
 * @since 1.607
 * @see AsynchronousExecution#displayCell()
 */
public boolean isDisplayCell() {
  AsynchronousExecution asynchronousExecution = getAsynchronousExecution();
  return asynchronousExecution == null || asynchronousExecution.displayCell();
}

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

private static boolean blocksRestart(Executor e) {
    if (e.isBusy()) {
      AsynchronousExecution execution = e.getAsynchronousExecution();
      if (execution != null) {
        return execution.blocksRestart();
      } else {
        return true;
      }
    } else {
      return false;
    }
  }
}

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

static boolean blocksRestart(WorkflowRun b) throws Exception {
  if (b.getExecutor().getAsynchronousExecution().blocksRestart()) {
    return true;
  }
  // TODO delete when implemented in workflow-cps:
  return b.getExecution().getCurrentExecutions(false).get(1, TimeUnit.SECONDS).stream().anyMatch(StepExecution::blocksRestart);
}

相关文章