本文整理了Java中hudson.remoting.Channel.close()
方法的一些代码示例,展示了Channel.close()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Channel.close()
方法的具体详情如下:
包路径:hudson.remoting.Channel
类名称:Channel
方法名:close
暂无
代码示例来源:origin: jenkinsci/jenkins
@Override
public synchronized void close() throws IOException {
super.close();
// wait for all the output from the process to be picked up
try {
t2.join();
} catch (InterruptedException e) {
// process the interrupt later
Thread.currentThread().interrupt();
}
}
};
代码示例来源: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
/**
* If still connected, disconnect.
*/
private void closeChannel() {
// TODO: race condition between this and the setChannel method.
Channel c;
synchronized (channelLock) {
c = channel;
channel = null;
absoluteRemoteFs = null;
isUnix = null;
}
if (c != null) {
try {
c.close();
} catch (IOException e) {
logger.log(Level.SEVERE, "Failed to terminate channel to " + getDisplayName(), e);
}
for (ComputerListener cl : ComputerListener.all())
cl.onOffline(this, offlineCause);
}
}
代码示例来源:origin: frohoff/ysoserial
public static final void main ( final String[] args ) {
if ( args.length < 3 ) {
System.err.println(JenkinsCLI.class.getName() + " <jenkins_url> <payload_type> <payload_arg>");
System.exit(-1);
}
final Object payloadObject = Utils.makePayloadObject(args[1], args[2]);
String jenkinsUrl = args[ 0 ];
Channel c = null;
try {
InetSocketAddress isa = JenkinsCLI.getCliPort(jenkinsUrl);
c = JenkinsCLI.openChannel(isa);
c.call(getPropertyCallable(payloadObject));
}
catch ( Throwable e ) {
e.printStackTrace();
}
finally {
if ( c != null ) {
try {
c.close();
}
catch ( IOException e ) {
e.printStackTrace(System.err);
}
}
}
Utils.releasePayload(args[1], payloadObject);
}
代码示例来源:origin: jenkinsci/jenkins
@Override
public void afterChannel(@NonNull JnlpConnectionState event) {
DefaultJnlpSlaveReceiver.State state = event.getStash(DefaultJnlpSlaveReceiver.State.class);
final SlaveComputer computer = state.getNode();
try {
computer.setChannel(event.getChannel(), state.getLog(), null);
} catch (IOException | InterruptedException e) {
PrintWriter logw = new PrintWriter(state.getLog(), true);
Functions.printStackTrace(e, logw);
try {
event.getChannel().close();
} catch (IOException x) {
LOGGER.log(Level.WARNING, null, x);
}
}
}
代码示例来源:origin: frohoff/ysoserial
if ( c != null ) {
try {
c.close();
代码示例来源:origin: frohoff/ysoserial
if ( c != null ) {
try {
c.close();
代码示例来源:origin: jenkinsci/jenkins
channel.close();
throw new IllegalStateException("Already connected");
代码示例来源:origin: org.jvnet.hudson.main/maven-plugin
/**
* Discards this maven process.
* It won't be reused in future builds.
*/
public void discard() {
try {
channel.close();
} catch (IOException e) {
LOGGER.log(Level.WARNING,"Failed to discard the maven process orderly",e);
}
}
代码示例来源:origin: org.eclipse.hudson.main/maven3-eventspy-common
public void close() throws IOException {
if (channel != null) {
log.debug("Closing");
channel.close();
channel = null;
log.debug("Closed");
}
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
@Override
public synchronized void close() throws IOException {
super.close();
// wait for all the output from the process to be picked up
try {
t2.join();
} catch (InterruptedException e) {
// process the interrupt later
Thread.currentThread().interrupt();
}
}
};
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
@Override
public synchronized void close() throws IOException {
super.close();
// wait for all the output from the process to be picked up
try {
t2.join();
} catch (InterruptedException e) {
// process the interrupt later
Thread.currentThread().interrupt();
}
}
};
代码示例来源:origin: hudson/hudson-2.x
@Override
public synchronized void close() throws IOException {
super.close();
// wait for the child process to complete
try {
proc.join();
} catch (InterruptedException e) {
// process the interrupt later
Thread.currentThread().interrupt();
}
}
};
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
@Override
public synchronized void close() throws IOException {
super.close();
// wait for the child process to complete
try {
proc.join();
} catch (InterruptedException e) {
// process the interrupt later
Thread.currentThread().interrupt();
}
}
};
代码示例来源:origin: hudson/hudson-2.x
public void close() throws IOException, InterruptedException {
channel.close();
channel.join();
if(ownsPool)
pool.shutdown();
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
@Override
public synchronized void close() throws IOException {
super.close();
// wait for the child process to complete
try {
proc.join();
} catch (InterruptedException e) {
// process the interrupt later
Thread.currentThread().interrupt();
}
}
};
代码示例来源:origin: hudson/hudson-2.x
protected void execute(Channel channel) {
try {
channel.close();
channel.terminate(new OrderlyShutdown(createdAt));
} catch (IOException e) {
logger.log(Level.SEVERE, "close command failed on " + channel.name, e);
logger.log(Level.INFO, "close command created at", createdAt);
}
}
代码示例来源: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: jenkinsci/selenium-plugin
@Override
public void stop() throws Exception {
for (Computer c : Jenkins.getInstance().getComputers()) {
for (SeleniumGlobalConfiguration cfg : configurations) {
cfg.stop(c);
}
}
this.listener.closeQuietly();
channel.close();
}
代码示例来源:origin: jenkinsci/selenium-plugin
/**
*
*/
public String call() throws Exception {
RemoteRunningStatus rs = getRunningStatus();
rs.setStatus("Stopping");
String url = callOnSubProcess(new RemoteStopSelenium(), null);
rs.setStatus("Stopped");
rs.setRunning(false);
rs.getSeleniumChannel().close();
return url;
}
内容来源于网络,如有侵权,请联系作者删除!