hudson.model.Computer.setNode()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(102)

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

Computer.setNode介绍

[英]Called to notify Computer that its corresponding Nodeconfiguration is updated.
[中]

代码示例

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

public Computer(Node node) {
  setNode(node);
}

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

@Override
protected void setNode(final Node node) {
  super.setNode(node);
  launcher = grabLauncher(node);
  // maybe the configuration was changed to relaunch the agent, so try to re-launch now.
  // "constructed==null" test is an ugly hack to avoid launching before the object is fully
  // constructed.
  if(constructed!=null) {
    if (node instanceof Slave) {
      Queue.withLock(new Runnable() {
        @Override
        public void run() {
          ((Slave)node).getRetentionStrategy().check(SlaveComputer.this);
        }
      });
    } else {
      connect(false);
    }
  }
}

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

if (c!=null) {
  try {
    c.setNode(n); // reuse
    used.add(c);
  } catch (RuntimeException e) {

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

public Computer(Node node) {
  setNode(node);
}

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

public Computer(Node node) {
  assert node.getNumExecutors()!=0 : "Computer created with 0 executors";
  setNode(node);
}

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

public Computer(Node node) {
  assert node.getNumExecutors()!=0 : "Computer created with 0 executors";
  setNode(node);
}

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

public Computer(Node node) {
  assert node.getNumExecutors()!=0 : "Computer created with 0 executors";
  setNode(node);
}

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

public Computer(Node node) {
  assert node.getNumExecutors() != 0 : "Computer created with 0 executors";
  setNode(node);
}

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

private void updateComputer(Node n, Map<String, Computer> byNameMap, Set<Computer> used) {
  Computer c;
  c = byNameMap.get(n.getNodeName());
  if (c != null) {
    c.setNode(n); // reuse
  } else {
    if (n.getNumExecutors() > 0) {
      computers.put(n, c = n.createComputer());
      if (!n.holdOffLaunchUntilSave && AUTOMATIC_SLAVE_LAUNCH) {
        RetentionStrategy retentionStrategy = c.getRetentionStrategy();
        if (retentionStrategy != null) {
          // if there is a retention strategy, it is responsible for deciding to start the computer
          retentionStrategy.start(c);
        } else {
          // we should never get here, but just in case, we'll fall back to the legacy behaviour
          c.connect(true);
        }
      }
    }
  }
  used.add(c);
}

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

@Override
protected void setNode(final Node node) {
  super.setNode(node);
  launcher = grabLauncher(node);
  // maybe the configuration was changed to relaunch the agent, so try to re-launch now.
  // "constructed==null" test is an ugly hack to avoid launching before the object is fully
  // constructed.
  if(constructed!=null) {
    if (node instanceof Slave) {
      Queue.withLock(new Runnable() {
        @Override
        public void run() {
          ((Slave)node).getRetentionStrategy().check(SlaveComputer.this);
        }
      });
    } else {
      connect(false);
    }
  }
}

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

private void updateComputer(Node n, Map<String, Computer> byNameMap, Set<Computer> used) {
  Computer c;
  c = byNameMap.get(n.getNodeName());
  if (c != null) {
    c.setNode(n); // reuse
  } else {
    if (n.getNumExecutors() > 0) {
      computers.put(n, c = n.createComputer());
      if (!n.holdOffLaunchUntilSave && AUTOMATIC_SLAVE_LAUNCH) {
        RetentionStrategy retentionStrategy = c.getRetentionStrategy();
        if (retentionStrategy != null) {
          // if there is a retention strategy, it is responsible for deciding to start the computer
          retentionStrategy.start(c);
        } else {
          // we should never get here, but just in case, we'll fall back to the legacy behaviour
          c.connect(true);
        }
      }
    }
  }
  used.add(c);
}

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

private void updateComputer(Node n, Map<String, Computer> byNameMap, Set<Computer> used) {
  Computer c;
  c = byNameMap.get(n.getNodeName());
  if (c != null) {
    c.setNode(n); // reuse
  } else {
    if (n.getNumExecutors() > 0) {
      computers.put(n, c = n.createComputer());
      if (!n.holdOffLaunchUntilSave && AUTOMATIC_SLAVE_LAUNCH) {
        RetentionStrategy retentionStrategy = c.getRetentionStrategy();
        if (retentionStrategy != null) {
          // if there is a retention strategy, it is responsible for deciding to start the computer
          retentionStrategy.start(c);
        } else {
          // we should never get here, but just in case, we'll fall back to the legacy behaviour
          c.connect(true);
        }
      }
    }
  }
  used.add(c);
}

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

private void updateComputer(Node n, Map<String, Computer> byNameMap, Set<Computer> used) {
  Computer c;
  c = byNameMap.get(n.getNodeName());
  if (c != null) {
    c.setNode(n); // reuse
  } else {
    if (n.getNumExecutors() > 0) {
      computers.put(n, c = n.createComputer());
      if (!n.holdOffLaunchUntilSave && AUTOMATIC_SLAVE_LAUNCH) {
        RetentionStrategy retentionStrategy = c.getRetentionStrategy();
        if (retentionStrategy != null) {
          // if there is a retention strategy, it is responsible for deciding to start the computer
          retentionStrategy.start(c);
        } else {
          // we should never get here, but just in case, we'll fall back to the legacy behaviour
          c.connect(true);
        }
      }
    }
  }
  used.add(c);
}

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

@Override
protected void setNode(Node node) {
  super.setNode(node);
  launcher = grabLauncher(node);
  // maybe the configuration was changed to relaunch the slave, so try to re-launch now.
  // "constructed==null" test is an ugly work around to avoid launching before the object is fully
  // constructed.
  if(constructed!=null) {
    if (node instanceof Slave)
      ((Slave)node).getRetentionStrategy().check(this);
    else
      connect(false);
  }
}

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

@Override
protected void setNode(Node node) {
  super.setNode(node);
  launcher = grabLauncher(node);
  // maybe the configuration was changed to relaunch the slave, so try to re-launch now.
  // "constructed==null" test is an ugly hack to avoid launching before the object is fully
  // constructed.
  if(constructed!=null) {
    if (node instanceof Slave)
      ((Slave)node).getRetentionStrategy().check(this);
    else
      connect(false);
  }
}

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

@Override
protected void setNode(Node node) {
  super.setNode(node);
  launcher = grabLauncher(node);
  // maybe the configuration was changed to relaunch the slave, so try to re-launch now.
  // "constructed==null" test is an ugly hack to avoid launching before the object is fully
  // constructed.
  if(constructed!=null) {
    if (node instanceof Slave)
      ((Slave)node).getRetentionStrategy().check(this);
    else
      connect(false);
  }
}

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

@Override
protected void setNode(Node node) {
  super.setNode(node);
  launcher = grabLauncher(node);
  // maybe the configuration was changed to relaunch the slave, so try to re-launch now.
  // "constructed==null" test is an ugly work around to avoid launching before the object is fully
  // constructed.
  if (constructed != null) {
    if (node instanceof Slave) {
      ((Slave) node).getRetentionStrategy().check(this);
    } else {
      connect(false);
    }
  }
}

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

if (c!=null) {
  try {
    c.setNode(n); // reuse
    used.add(c);
  } catch (RuntimeException e) {

相关文章

微信公众号

最新文章

更多