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

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

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

Node.createComputer介绍

[英]Creates a new Computer object that acts as the UI peer of this Node. Nobody but Hudson#updateComputerList() should call this method.
[中]创建一个新的计算机对象,作为此节点的UI对等对象。除了Hudson#updateComputerList()之外,没有人应该调用此方法。

代码示例

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

  1. c = n.createComputer();
  2. } catch(RuntimeException ex) { // Just in case there is a bogus extension
  3. LOGGER.log(Level.WARNING, "Error retrieving computer for node " + n.getNodeName() + ", continuing", ex);

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

  1. private void updateComputer(Node n, Map<String, Computer> byNameMap, Set<Computer> used) {
  2. Computer c;
  3. c = byNameMap.get(n.getNodeName());
  4. if (c != null) {
  5. c.setNode(n); // reuse
  6. } else {
  7. if (n.getNumExecutors() > 0) {
  8. computers.put(n, c = n.createComputer());
  9. if (!n.holdOffLaunchUntilSave && AUTOMATIC_SLAVE_LAUNCH) {
  10. RetentionStrategy retentionStrategy = c.getRetentionStrategy();
  11. if (retentionStrategy != null) {
  12. // if there is a retention strategy, it is responsible for deciding to start the computer
  13. retentionStrategy.start(c);
  14. } else {
  15. // we should never get here, but just in case, we'll fall back to the legacy behaviour
  16. c.connect(true);
  17. }
  18. }
  19. }
  20. }
  21. used.add(c);
  22. }

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

  1. private void updateComputer(Node n, Map<String, Computer> byNameMap, Set<Computer> used) {
  2. Computer c;
  3. c = byNameMap.get(n.getNodeName());
  4. if (c != null) {
  5. c.setNode(n); // reuse
  6. } else {
  7. if (n.getNumExecutors() > 0) {
  8. computers.put(n, c = n.createComputer());
  9. if (!n.holdOffLaunchUntilSave && AUTOMATIC_SLAVE_LAUNCH) {
  10. RetentionStrategy retentionStrategy = c.getRetentionStrategy();
  11. if (retentionStrategy != null) {
  12. // if there is a retention strategy, it is responsible for deciding to start the computer
  13. retentionStrategy.start(c);
  14. } else {
  15. // we should never get here, but just in case, we'll fall back to the legacy behaviour
  16. c.connect(true);
  17. }
  18. }
  19. }
  20. }
  21. used.add(c);
  22. }

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

  1. private void updateComputer(Node n, Map<String, Computer> byNameMap, Set<Computer> used) {
  2. Computer c;
  3. c = byNameMap.get(n.getNodeName());
  4. if (c != null) {
  5. c.setNode(n); // reuse
  6. } else {
  7. if (n.getNumExecutors() > 0) {
  8. computers.put(n, c = n.createComputer());
  9. if (!n.holdOffLaunchUntilSave && AUTOMATIC_SLAVE_LAUNCH) {
  10. RetentionStrategy retentionStrategy = c.getRetentionStrategy();
  11. if (retentionStrategy != null) {
  12. // if there is a retention strategy, it is responsible for deciding to start the computer
  13. retentionStrategy.start(c);
  14. } else {
  15. // we should never get here, but just in case, we'll fall back to the legacy behaviour
  16. c.connect(true);
  17. }
  18. }
  19. }
  20. }
  21. used.add(c);
  22. }

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

  1. private void updateComputer(Node n, Map<String, Computer> byNameMap, Set<Computer> used) {
  2. Computer c;
  3. c = byNameMap.get(n.getNodeName());
  4. if (c != null) {
  5. c.setNode(n); // reuse
  6. } else {
  7. if (n.getNumExecutors() > 0) {
  8. computers.put(n, c = n.createComputer());
  9. if (!n.holdOffLaunchUntilSave && AUTOMATIC_SLAVE_LAUNCH) {
  10. RetentionStrategy retentionStrategy = c.getRetentionStrategy();
  11. if (retentionStrategy != null) {
  12. // if there is a retention strategy, it is responsible for deciding to start the computer
  13. retentionStrategy.start(c);
  14. } else {
  15. // we should never get here, but just in case, we'll fall back to the legacy behaviour
  16. c.connect(true);
  17. }
  18. }
  19. }
  20. }
  21. used.add(c);
  22. }

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

  1. c = n.createComputer();
  2. } catch(RuntimeException ex) { // Just in case there is a bogus extension
  3. LOGGER.log(Level.WARNING, "Error retrieving computer for node " + n.getNodeName() + ", continuing", ex);

相关文章