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

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

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

Node.getChannel介绍

[英]Gets the current channel, if the node is connected and online, or null. This is just a convenience method for Computer#getChannel() with null check.
[中]获取当前通道(如果节点已连接且处于联机状态),或获取null。这只是带有空检查的计算机#getChannel()的一种方便方法。

代码示例

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

  1. /**
  2. * Gets the {@link FilePath} on this node.
  3. */
  4. public @CheckForNull FilePath createPath(String absolutePath) {
  5. VirtualChannel ch = getChannel();
  6. if(ch==null) return null; // offline
  7. return new FilePath(ch,absolutePath);
  8. }

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

  1. /**
  2. * Estimates the clock difference with this agent.
  3. *
  4. * @return
  5. * always non-null.
  6. * @throws InterruptedException
  7. * if the operation is aborted.
  8. */
  9. public ClockDifference getClockDifference() throws IOException, InterruptedException {
  10. VirtualChannel channel = getChannel();
  11. if(channel==null)
  12. throw new IOException(getNodeName()+" is offline");
  13. return channel.call(getClockDifferenceCallable());
  14. }

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

  1. throw new NullPointerException("no such build node: " + build.getBuiltOnStr());
  2. throw new NullPointerException("no workspace from node " + node + " which is computer " + node.toComputer() + " and has channel " + node.getChannel());

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

  1. /**
  2. * Gets the {@link FilePath} on this node.
  3. */
  4. public @CheckForNull FilePath createPath(String absolutePath) {
  5. VirtualChannel ch = getChannel();
  6. if(ch==null) return null; // offline
  7. return new FilePath(ch,absolutePath);
  8. }

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

  1. /**
  2. * Determines the platform of the given node.
  3. */
  4. public static Platform of(Node n) throws IOException, InterruptedException, DetectionFailedException {
  5. return n.getChannel().call(new Callable<Platform, DetectionFailedException>() {
  6. @Override
  7. public Platform call() throws DetectionFailedException {
  8. return current();
  9. }
  10. });
  11. }

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

  1. /**
  2. * Gets the {@link FilePath} on this node.
  3. */
  4. public FilePath createPath(String absolutePath) {
  5. VirtualChannel ch = getChannel();
  6. if(ch==null) return null; // offline
  7. return new FilePath(ch,absolutePath);
  8. }

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

  1. /**
  2. * Determines the platform of the given node.
  3. */
  4. public static Platform of(Node n) throws IOException,InterruptedException,DetectionFailedException {
  5. return n.getChannel().call(new Callable<Platform,DetectionFailedException>() {
  6. public Platform call() throws DetectionFailedException {
  7. return current();
  8. }
  9. });
  10. }

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

  1. /**
  2. * Gets the {@link FilePath} on this node.
  3. */
  4. public FilePath createPath(String absolutePath) {
  5. VirtualChannel ch = getChannel();
  6. if (ch == null) {
  7. return null; // offline
  8. }
  9. return new FilePath(ch, absolutePath);
  10. }

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

  1. /**
  2. * Gets the {@link FilePath} on this node.
  3. */
  4. public FilePath createPath(String absolutePath) {
  5. VirtualChannel ch = getChannel();
  6. if(ch==null) return null; // offline
  7. return new FilePath(ch,absolutePath);
  8. }

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

  1. /**
  2. * Gets the {@link FilePath} on this node.
  3. */
  4. public FilePath createPath(String absolutePath) {
  5. VirtualChannel ch = getChannel();
  6. if(ch==null) return null; // offline
  7. return new FilePath(ch,absolutePath);
  8. }

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

  1. /**
  2. * Determines the CPU of the given node.
  3. */
  4. public static CPU of(Node n) throws IOException,InterruptedException, DetectionFailedException {
  5. return n.getChannel().call(new Callable<CPU,DetectionFailedException>() {
  6. public CPU call() throws DetectionFailedException {
  7. return current();
  8. }
  9. });
  10. }

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

  1. /**
  2. * Determines the CPU of the given node.
  3. */
  4. public static CPU of(Node n) throws IOException, InterruptedException, DetectionFailedException {
  5. return n.getChannel().call(new Callable<CPU, DetectionFailedException>() {
  6. @Override
  7. public CPU call() throws DetectionFailedException {
  8. return current();
  9. }
  10. });
  11. }

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

  1. /**
  2. * Determines the platform of the given node.
  3. */
  4. public static Platform of(Node n) throws IOException,InterruptedException,DetectionFailedException {
  5. return n.getChannel().call(new Callable<Platform,DetectionFailedException>() {
  6. public Platform call() throws DetectionFailedException {
  7. return current();
  8. }
  9. });
  10. }

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

  1. /**
  2. * Determines the CPU of the given node.
  3. */
  4. public static CPU of(Node n) throws IOException,InterruptedException, DetectionFailedException {
  5. return n.getChannel().call(new Callable<CPU,DetectionFailedException>() {
  6. public CPU call() throws DetectionFailedException {
  7. return current();
  8. }
  9. });
  10. }

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

  1. /**
  2. * Determines the CPU of the given node.
  3. */
  4. public static CPU of(Node n) throws IOException,InterruptedException, DetectionFailedException {
  5. return n.getChannel().call(new Callable<CPU,DetectionFailedException>() {
  6. public CPU call() throws DetectionFailedException {
  7. return current();
  8. }
  9. });
  10. }

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

  1. /**
  2. * Determines the platform of the given node.
  3. */
  4. public static Platform of(Node n) throws IOException,InterruptedException,DetectionFailedException {
  5. return n.getChannel().call(new GetCurrentPlatform());
  6. }

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

  1. /**
  2. * Determines the CPU of the given node.
  3. */
  4. public static CPU of(Node n) throws IOException,InterruptedException, DetectionFailedException {
  5. return n.getChannel().call(new GetCurrentCPU());
  6. }

代码示例来源:origin: jenkinsci/android-emulator-plugin

  1. @SuppressWarnings("serial")
  2. private static AndroidSdk getAndroidSdkForNode(Node node, final String androidHome,
  3. final String androidSdkHome) throws IOException, InterruptedException {
  4. final VirtualChannel channel = node.getChannel();
  5. if (channel == null) {
  6. throw new BuildNodeUnavailableException();
  7. }
  8. return channel.call(new MasterToSlaveCallable<AndroidSdk, IOException>() {
  9. public AndroidSdk call() throws IOException {
  10. return new AndroidSdk(androidHome, androidSdkHome);
  11. }
  12. });
  13. }

代码示例来源:origin: groupon/DotCi

  1. private FilePath getFilePath(final AbstractBuild<?, ?> build) {
  2. final FilePath ws = build.getWorkspace();
  3. if (ws == null) {
  4. final Node node = build.getBuiltOn();
  5. if (node == null) {
  6. throw new RuntimeException("no such build node: " + build.getBuiltOnStr());
  7. }
  8. throw new RuntimeException("no workspace from node " + node + " which is computer " + node.toComputer() + " and has channel " + node.getChannel());
  9. }
  10. return ws;
  11. }

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

  1. @SuppressFBWarnings("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE")
  2. private Installable getInstallable(Node node) throws IOException, InterruptedException {
  3. // Get the Go release that we want to install
  4. GolangRelease release = getConfiguredRelease();
  5. if (release == null) {
  6. return null;
  7. }
  8. // Gather properties for the node to install on
  9. String[] properties = node.getChannel().call(new GetSystemProperties("os.name", "os.arch", "os.version"));
  10. // Get the best matching install candidate for this node
  11. return getInstallCandidate(release, properties[0], properties[1], properties[2]);
  12. }

相关文章