@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(); } } };
/** * 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(); }
/** * 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); } }
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); }
@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); } } }
if ( c != null ) { try { c.close();
if ( c != null ) { try { c.close();
channel.close(); throw new IllegalStateException("Already connected");
/** * 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); } }
public void close() throws IOException { if (channel != null) { log.debug("Closing"); channel.close(); channel = null; log.debug("Closed"); } }
@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(); } } };
@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(); } } };
@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(); } } };
@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(); } } };
public void close() throws IOException, InterruptedException { channel.close(); channel.join(); if(ownsPool) pool.shutdown(); }
@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(); } } };
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); } }
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 }
@Override public void stop() throws Exception { for (Computer c : Jenkins.getInstance().getComputers()) { for (SeleniumGlobalConfiguration cfg : configurations) { cfg.stop(c); } } this.listener.closeQuietly(); channel.close(); }
/** * */ 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; }