void close() { if (status == RUNNING) { status = CLOSED; Utils.close(driver); } }
public void destroy() { Utils.close(console); thread.interrupt(); }
public void close() { if (closed.compareAndSet(false, true)) { for (Closeable closeable : closeables) { log.log(Level.FINE, "Closing " + closeable.getClass().getSimpleName()); Utils.close(closeable); } } } }
public static void copy(InputStream in, OutputStream out) throws IOException { if (in == null) { throw new NullPointerException(); } try { byte[] buffer = new byte[256]; for (int l = in.read(buffer); l != -1; l = in.read(buffer)) { out.write(buffer, 0, l); } } finally { close(in); } }
public void on(KeyStroke keyStroke) { // if (keyStroke.operation == Operation.INTERRUPT) { Plugin current = handler.get(); if (current == null) { throw new IllegalStateException("Not initialized"); } else if (current instanceof ProcessHandler) { ProcessHandler processHandler = (ProcessHandler)current; ProcessHandler.Reader reader = processHandler.editor.get(); if (reader != null) { reader.thread.interrupt(); } processHandler.process.cancel(); return; } } buffer.add(keyStroke); // iterate(); // This was modified by this thread during the loop if (status == CLOSING) { status = CLOSED; Utils.close(driver); } }
Utils.close(i);
Utils.close(container);
public void testClose() { Exception closed = Utils.close(new Closeable() { public void close() throws IOException { assertNull(closed); final IOException ioe = new IOException(); closed = Utils.close(new Closeable() { public void close() throws IOException { throw ioe; assertSame(ioe, closed); final RuntimeException re = new RuntimeException(); closed = Utils.close(new Closeable() { public void close() throws IOException { throw re; final Error thrown = new Error(); try { Utils.close(new Closeable() { public void close() throws IOException { throw thrown;
@Override ShellResponse doInvoke(final ShellProcessContext context) throws InterruptedException { CRaSHProcessContext invocationContext = new CRaSHProcessContext(session, context); try { command.invoke(invocationContext); return ShellResponse.ok(); } catch (CommandException e) { return build(e); } catch (Throwable t) { return build(t); } finally { Utils.close(invocationContext); } }
Utils.close(closeable);
public SSHClient close() { try { Utils.close(out); channel.close(false); session.close(false); client.stop(); return this; } finally { this.client = null; this.channel = null; this.session = null; this.out = null; } } }
void close() { if (status == RUNNING) { status = CLOSED; Utils.close(driver); } }
public void destroy() { Utils.close(console); thread.interrupt(); }