hudson.model.Node.isAcceptingTasks()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(122)

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

Node.isAcceptingTasks介绍

[英]Returns true if the node is accepting tasks. Needed to allow agents programmatic suspension of task scheduling that does not overlap with being offline. Called by Computer#isAcceptingTasks(). This method is distinct from Computer#isAcceptingTasks() as sometimes the Node concrete class may not have control over the hudson.model.Computer concrete class associated with it.
[中]如果节点正在接受任务,则返回true。需要允许代理程序暂停与脱机不重叠的任务调度。由计算机调用#isAcceptingTasks()。此方法与Computer#isAcceptingTasks()不同,因为有时节点具体类可能无法控制hudson。模型与之相关的计算机具体类。

代码示例

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

  1. /**
  2. * Returns {@code true} if the computer is accepting tasks. Needed to allow agents programmatic suspension of task
  3. * scheduling that does not overlap with being offline.
  4. *
  5. * @return {@code true} if the computer is accepting tasks
  6. * @see hudson.slaves.RetentionStrategy#isAcceptingTasks(Computer)
  7. * @see hudson.model.Node#isAcceptingTasks()
  8. */
  9. @OverridingMethodsMustInvokeSuper
  10. public boolean isAcceptingTasks() {
  11. final Node node = getNode();
  12. return getRetentionStrategy().isAcceptingTasks(this) && (node == null || node.isAcceptingTasks());
  13. }

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

  1. if (!isAcceptingTasks()) {
  2. return new CauseOfBlockage.BecauseNodeIsNotAcceptingTasks(this);

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

  1. private static boolean isNotAcceptingTasks(Node n) {
  2. return n.toComputer().isLaunchSupported() // Launcher hasn't been called yet
  3. || !n.isAcceptingTasks() // node is not ready yet
  4. ;
  5. }

代码示例来源:origin: carlossg/jenkins-kubernetes-plugin

  1. private static boolean isNotAcceptingTasks(Node n) {
  2. return n.toComputer().isLaunchSupported() // Launcher hasn't been called yet
  3. || !n.isAcceptingTasks() // node is not ready yet
  4. ;
  5. }

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

  1. /**
  2. * Returns {@code true} if the computer is accepting tasks. Needed to allow agents programmatic suspension of task
  3. * scheduling that does not overlap with being offline.
  4. *
  5. * @return {@code true} if the computer is accepting tasks
  6. * @see hudson.slaves.RetentionStrategy#isAcceptingTasks(Computer)
  7. * @see hudson.model.Node#isAcceptingTasks()
  8. */
  9. @OverridingMethodsMustInvokeSuper
  10. public boolean isAcceptingTasks() {
  11. final Node node = getNode();
  12. return getRetentionStrategy().isAcceptingTasks(this) && (node == null || node.isAcceptingTasks());
  13. }

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

  1. if (!isAcceptingTasks()) {
  2. return new CauseOfBlockage.BecauseNodeIsNotAcceptingTasks(this);

相关文章