本文整理了Java中hudson.remoting.Channel.join()
方法的一些代码示例,展示了Channel.join()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Channel.join()
方法的具体详情如下:
包路径:hudson.remoting.Channel
类名称:Channel
方法名:join
[英]Waits for this Channel to be closed down.
The close-down of a Channel might be initiated locally or remotely.
[中]等待关闭此通道。
通道关闭可以在本地或远程启动。
代码示例来源:origin: jenkinsci/jenkins
/**
* Shuts down the channel and closes the underlying connection.
*/
public void close() throws IOException, InterruptedException {
channel.close();
channel.join();
if(ownsPool)
pool.shutdown();
for (Closeable c : closables)
c.close();
}
代码示例来源:origin: jenkinsci/jenkins
protected void runCli(Connection c) throws IOException, InterruptedException {
ChannelBuilder cb;
String name = "CLI channel from " + socket.getInetAddress();
// Connection can contain cipher wrapper, which can't be NIO-ed.
// if (hub!=null)
// cb = hub.newChannelBuilder(name, Computer.threadPoolForRemoting);
// else
cb = new ChannelBuilder(name, Computer.threadPoolForRemoting);
Channel channel = cb
.withMode(Mode.BINARY)
.withRestricted(true)
.withBaseLoader(Jenkins.getActiveInstance().pluginManager.uberClassLoader)
.build(new BufferedInputStream(c.in), new BufferedOutputStream(c.out));
channel.setProperty(CliEntryPoint.class.getName(),new CliManagerImpl(channel));
channel.join();
}
}
代码示例来源:origin: jenkinsci/jenkins
@Override
protected void run(final InputStream upload, OutputStream download) throws IOException, InterruptedException {
channel = new Channel("HTTP full-duplex channel " + uuid,
Computer.threadPoolForRemoting, Mode.BINARY, upload, download, null, restricted);
// so that we can detect dead clients, periodically send something
PingThread ping = new PingThread(channel) {
@Override
protected void onDead(Throwable diagnosis) {
LOGGER.log(Level.INFO, "Duplex-HTTP session " + uuid + " is terminated", diagnosis);
// this will cause the channel to abort and subsequently clean up
try {
upload.close();
} catch (IOException e) {
// this can never happen
throw new AssertionError(e);
}
}
@Override
protected void onDead() {
onDead(null);
}
};
ping.start();
main(channel);
channel.join();
ping.interrupt();
}
代码示例来源:origin: org.hudsonci.plugins/maven3-eventspy-common
public void join() throws InterruptedException {
log.debug("Joining");
getChannel().join();
log.debug("Joined");
}
代码示例来源:origin: org.eclipse.hudson.main/maven3-eventspy-common
public void join() throws InterruptedException {
log.debug("Joining");
getChannel().join();
log.debug("Joined");
}
代码示例来源:origin: hudson/hudson-2.x
public void close() throws IOException, InterruptedException {
channel.close();
channel.join();
if(ownsPool)
pool.shutdown();
}
代码示例来源:origin: org.jvnet.hudson.main/maven3-eventspy-common
public void join() throws InterruptedException {
log.debug("Joining");
getChannel().join();
log.debug("Joined");
}
代码示例来源:origin: jenkinsci/jenkins-test-harness
@Override
public synchronized void onTearDown() throws Exception {
for (Channel c : channels)
c.close();
for (Channel c : channels)
c.join();
channels.clear();
}
}
代码示例来源:origin: jenkinsci/acceptance-test-harness
@Override
public void tearDown() throws IOException {
channel.close();
try {
channel.join(3000);
} catch (InterruptedException e) {
throw new IOException(e);
} finally {
if (conn !=null)
conn.close();
conn = null;
}
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* Handles CLI connection request.
*/
private void runCliConnect(DataInputStream in, PrintWriter out) throws IOException, InterruptedException {
out.println("Welcome");
Channel channel = new Channel("CLI channel from " + s.getInetAddress(),
Computer.threadPoolForRemoting, Mode.BINARY,
new BufferedInputStream(new SocketInputStream(this.s)),
new BufferedOutputStream(new SocketOutputStream(this.s)), null, true);
channel.setProperty(CliEntryPoint.class.getName(), new CliManagerImpl());
channel.join();
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* Handles CLI connection request.
*/
private void runCliConnect(DataInputStream in, PrintWriter out) throws IOException, InterruptedException {
out.println("Welcome");
Channel channel = new Channel("CLI channel from " + s.getInetAddress(),
Computer.threadPoolForRemoting, Mode.BINARY,
new BufferedInputStream(new SocketInputStream(this.s)),
new BufferedOutputStream(new SocketOutputStream(this.s)), null, true);
channel.setProperty(CliEntryPoint.class.getName(),new CliManagerImpl());
channel.join();
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Handles CLI connection request.
*/
private void runCliConnect(DataInputStream in, PrintWriter out) throws IOException, InterruptedException {
out.println("Welcome");
Channel channel = new Channel("CLI channel from " + s.getInetAddress(),
Computer.threadPoolForRemoting, Mode.BINARY,
new BufferedInputStream(new SocketInputStream(this.s)),
new BufferedOutputStream(new SocketOutputStream(this.s)), null, true);
channel.setProperty(CliEntryPoint.class.getName(),new CliManagerImpl());
channel.join();
}
代码示例来源:origin: jenkinsci/remoting
public void stop(Channel channel) throws Exception {
channel.close();
channel.join();
System.out.println("north completed");
executor.shutdown();
if(failure!=null)
throw failure; // report a failure in the south side
}
代码示例来源:origin: hudson/hudson-2.x
/**
* Handles CLI connection request.
*/
private void runCliConnect(DataInputStream in, PrintWriter out) throws IOException, InterruptedException {
out.println("Welcome");
Channel channel = new Channel("CLI channel from " + s.getInetAddress(),
Computer.threadPoolForRemoting, Mode.BINARY,
new BufferedInputStream(new SocketInputStream(this.s)),
new BufferedOutputStream(new SocketOutputStream(this.s)), null, true);
channel.setProperty(CliEntryPoint.class.getName(),new CliManagerImpl());
channel.join();
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
protected void runCli(Connection c) throws IOException, InterruptedException {
ChannelBuilder cb;
String name = "CLI channel from " + socket.getInetAddress();
// Connection can contain cipher wrapper, which can't be NIO-ed.
// if (hub!=null)
// cb = hub.newChannelBuilder(name, Computer.threadPoolForRemoting);
// else
cb = new ChannelBuilder(name, Computer.threadPoolForRemoting);
Channel channel = cb
.withMode(Mode.BINARY)
.withRestricted(true)
.withBaseLoader(Jenkins.getActiveInstance().pluginManager.uberClassLoader)
.build(new BufferedInputStream(c.in), new BufferedOutputStream(c.out));
channel.setProperty(CliEntryPoint.class.getName(),new CliManagerImpl(channel));
channel.join();
}
}
代码示例来源:origin: jenkinsci/remoting
public static void main(String[] args) throws Exception {
ServerSocket ss = new ServerSocket(PORT);
while (true) {
System.out.println("Ready");
Socket s = ss.accept();
s.setTcpNoDelay(true);
System.out.println("Accepted");
Channel ch = new Channel("bogus", Executors.newCachedThreadPool(),
new BufferedInputStream(SocketChannelStream.in(s)),
new BufferedOutputStream(SocketChannelStream.out(s)));
ch.join();
s.close();
}
}
public static final int PORT = 9532;
代码示例来源:origin: jenkinsci/remoting
public void stop(Channel channel) throws Exception {
channel.close();
channel.join();
System.out.println("north completed");
// we initiate the shutdown from north, so by the time it closes south should be all closed, too
/* TODO passes reliably on Java 7 but often fails on Java 8
assertTrue(south.isInClosed());
assertTrue(south.isOutClosed());
*/
nio.close();
executor.shutdown();
if(failure!=null)
throw new AssertionError(failure); // report a failure in the south side
}
代码示例来源:origin: jenkinsci/remoting
public void run() {
try {
Channel south = configureSouth().build(in2,out1);
southHandoff.put(south);
south.join();
System.out.println("south completed");
} catch (Exception e) {
e.printStackTrace();
failure = e;
}
}
};
代码示例来源:origin: jenkinsci/remoting
public void stop(Channel channel) throws Exception {
channel.close();
channel.join(10*1000);
// System.out.println("north completed");
executor.shutdown();
copier.join();
int r = proc.waitFor();
// System.out.println("south completed");
assertEquals("exit code should have been 0", 0, r);
}
代码示例来源:origin: jenkinsci/remoting
public void run() {
try {
Channel south = nio.newChannelBuilder("south",executor).withMode(Mode.NEGOTIATE)
.build(n2s.source(), s2n.sink());
southHandoff.put(south);
south.join();
System.out.println("south completed");
} catch (Exception e) {
e.printStackTrace();
failure = e;
}
}
});
内容来源于网络,如有侵权,请联系作者删除!