本文整理了Java中hudson.model.Node.getChannel()
方法的一些代码示例,展示了Node.getChannel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getChannel()
方法的具体详情如下:
包路径:hudson.model.Node
类名称: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
/**
* Gets the {@link FilePath} on this node.
*/
public @CheckForNull FilePath createPath(String absolutePath) {
VirtualChannel ch = getChannel();
if(ch==null) return null; // offline
return new FilePath(ch,absolutePath);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Estimates the clock difference with this agent.
*
* @return
* always non-null.
* @throws InterruptedException
* if the operation is aborted.
*/
public ClockDifference getClockDifference() throws IOException, InterruptedException {
VirtualChannel channel = getChannel();
if(channel==null)
throw new IOException(getNodeName()+" is offline");
return channel.call(getClockDifferenceCallable());
}
代码示例来源:origin: jenkinsci/jenkins
throw new NullPointerException("no such build node: " + build.getBuiltOnStr());
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
/**
* Gets the {@link FilePath} on this node.
*/
public @CheckForNull FilePath createPath(String absolutePath) {
VirtualChannel ch = getChannel();
if(ch==null) return null; // offline
return new FilePath(ch,absolutePath);
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* Determines the platform of the given node.
*/
public static Platform of(Node n) throws IOException, InterruptedException, DetectionFailedException {
return n.getChannel().call(new Callable<Platform, DetectionFailedException>() {
@Override
public Platform call() throws DetectionFailedException {
return current();
}
});
}
代码示例来源:origin: hudson/hudson-2.x
/**
* Gets the {@link FilePath} on this node.
*/
public FilePath createPath(String absolutePath) {
VirtualChannel ch = getChannel();
if(ch==null) return null; // offline
return new FilePath(ch,absolutePath);
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Determines the platform of the given node.
*/
public static Platform of(Node n) throws IOException,InterruptedException,DetectionFailedException {
return n.getChannel().call(new Callable<Platform,DetectionFailedException>() {
public Platform call() throws DetectionFailedException {
return current();
}
});
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* Gets the {@link FilePath} on this node.
*/
public FilePath createPath(String absolutePath) {
VirtualChannel ch = getChannel();
if (ch == null) {
return null; // offline
}
return new FilePath(ch, absolutePath);
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Gets the {@link FilePath} on this node.
*/
public FilePath createPath(String absolutePath) {
VirtualChannel ch = getChannel();
if(ch==null) return null; // offline
return new FilePath(ch,absolutePath);
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* Gets the {@link FilePath} on this node.
*/
public FilePath createPath(String absolutePath) {
VirtualChannel ch = getChannel();
if(ch==null) return null; // offline
return new FilePath(ch,absolutePath);
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Determines the CPU of the given node.
*/
public static CPU of(Node n) throws IOException,InterruptedException, DetectionFailedException {
return n.getChannel().call(new Callable<CPU,DetectionFailedException>() {
public CPU call() throws DetectionFailedException {
return current();
}
});
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* Determines the CPU of the given node.
*/
public static CPU of(Node n) throws IOException, InterruptedException, DetectionFailedException {
return n.getChannel().call(new Callable<CPU, DetectionFailedException>() {
@Override
public CPU call() throws DetectionFailedException {
return current();
}
});
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* Determines the platform of the given node.
*/
public static Platform of(Node n) throws IOException,InterruptedException,DetectionFailedException {
return n.getChannel().call(new Callable<Platform,DetectionFailedException>() {
public Platform call() throws DetectionFailedException {
return current();
}
});
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* Determines the CPU of the given node.
*/
public static CPU of(Node n) throws IOException,InterruptedException, DetectionFailedException {
return n.getChannel().call(new Callable<CPU,DetectionFailedException>() {
public CPU call() throws DetectionFailedException {
return current();
}
});
}
代码示例来源:origin: hudson/hudson-2.x
/**
* Determines the CPU of the given node.
*/
public static CPU of(Node n) throws IOException,InterruptedException, DetectionFailedException {
return n.getChannel().call(new Callable<CPU,DetectionFailedException>() {
public CPU call() throws DetectionFailedException {
return current();
}
});
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Determines the platform of the given node.
*/
public static Platform of(Node n) throws IOException,InterruptedException,DetectionFailedException {
return n.getChannel().call(new GetCurrentPlatform());
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Determines the CPU of the given node.
*/
public static CPU of(Node n) throws IOException,InterruptedException, DetectionFailedException {
return n.getChannel().call(new GetCurrentCPU());
}
代码示例来源:origin: jenkinsci/android-emulator-plugin
@SuppressWarnings("serial")
private static AndroidSdk getAndroidSdkForNode(Node node, final String androidHome,
final String androidSdkHome) throws IOException, InterruptedException {
final VirtualChannel channel = node.getChannel();
if (channel == null) {
throw new BuildNodeUnavailableException();
}
return channel.call(new MasterToSlaveCallable<AndroidSdk, IOException>() {
public AndroidSdk call() throws IOException {
return new AndroidSdk(androidHome, androidSdkHome);
}
});
}
代码示例来源:origin: groupon/DotCi
private FilePath getFilePath(final AbstractBuild<?, ?> build) {
final FilePath ws = build.getWorkspace();
if (ws == null) {
final Node node = build.getBuiltOn();
if (node == null) {
throw new RuntimeException("no such build node: " + build.getBuiltOnStr());
}
throw new RuntimeException("no workspace from node " + node + " which is computer " + node.toComputer() + " and has channel " + node.getChannel());
}
return ws;
}
代码示例来源:origin: jenkinsci/golang-plugin
@SuppressFBWarnings("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE")
private Installable getInstallable(Node node) throws IOException, InterruptedException {
// Get the Go release that we want to install
GolangRelease release = getConfiguredRelease();
if (release == null) {
return null;
}
// Gather properties for the node to install on
String[] properties = node.getChannel().call(new GetSystemProperties("os.name", "os.arch", "os.version"));
// Get the best matching install candidate for this node
return getInstallCandidate(release, properties[0], properties[1], properties[2]);
}
内容来源于网络,如有侵权,请联系作者删除!