本文整理了Java中hudson.remoting.Channel.currentOrFail()
方法的一些代码示例,展示了Channel.currentOrFail()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Channel.currentOrFail()
方法的具体详情如下:
包路径:hudson.remoting.Channel
类名称:Channel
方法名:currentOrFail
[英]Gets current channel or fails with IllegalStateException.
[中]获取当前通道或因IllegalStateException失败。
代码示例来源:origin: jenkinsci/jenkins
public int main(List<String> args, Locale locale, InputStream stdin, OutputStream stdout, OutputStream stderr) {
// remoting sets the context classloader to the RemoteClassLoader,
// which slows down the classloading. we don't load anything from CLI,
// so counter that effect.
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
PrintStream out = new PrintStream(stdout);
PrintStream err = new PrintStream(stderr);
String subCmd = args.get(0);
CLICommand cmd = CLICommand.clone(subCmd);
if(cmd!=null) {
cmd.channel = Channel.current();
final CLICommand old = CLICommand.setCurrent(cmd);
try {
transportAuth = Channel.currentOrFail().getProperty(CLICommand.TRANSPORT_AUTHENTICATION);
cmd.setTransportAuth(transportAuth);
return cmd.main(args.subList(1,args.size()),locale, stdin, out, err);
} finally {
CLICommand.setCurrent(old);
}
}
err.println("No such command: "+subCmd);
new HelpCommand().main(Collections.emptyList(), locale, stdin, out, err);
return -1;
}
代码示例来源:origin: jenkinsci/remoting
public Void call() throws RuntimeException {
Channel.currentOrFail().maximumBytecodeLevel = level;
return null;
}
代码示例来源:origin: jenkinsci/remoting
@Override
public Object call() throws InterruptedException {
Channel.currentOrFail().syncLocalIO();
return null;
}
代码示例来源:origin: jenkinsci/remoting
public ISaturationTest call() throws IOException {
return Channel.currentOrFail().export(ISaturationTest.class, new ISaturationTest() {
private InputStream in;
public void ensureConnected() throws IOException {
in = pipe.getIn();
}
public int readFirst() throws IOException {
return in.read();
}
public void readRest() throws IOException {
new DataInputStream(in).readFully(new byte[Channel.PIPE_WINDOW_SIZE*2]);
}
});
}
}
代码示例来源:origin: jenkinsci/remoting
public Void call() throws IOException {
Channel.currentOrFail().setJarCache(new FileSystemJarCache(dir, true));
return null;
}
}
代码示例来源:origin: jenkinsci/remoting
public String call() throws Exception {
return Channel.currentOrFail().call(new GunImporter());
}
}
代码示例来源:origin: jenkinsci/remoting
if(goingHome) return Channel.currentOrFail().getExportedObject(oid);
else return proxy;
代码示例来源:origin: jenkinsci/remoting
public Void call() throws IOException {
try {
final Channel ch = Channel.currentOrFail();
final JarCache jarCache = ch.getJarCache();
if (jarCache == null) {
throw new IOException("Cannot Force JAR load, JAR cache is disabled");
}
jarCache.resolve(ch,sum1,sum2).get();
return null;
} catch (InterruptedException e) {
throw new IOException(e);
} catch (ExecutionException e) {
throw new IOException(e);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!