@Override public void close() throws IOException { delegate.close(); } }
@Override public void close() throws IOException { delegate.close(); } }
@Override public void close() throws IOException { delegate.close(); } }
/** * Stops the reactor and related resources such as dispatcher. * * @throws InterruptedException * if interrupted while stopping the reactor. * @throws IOException * if any I/O error occurs. */ public void stop() throws InterruptedException, IOException { reactorMain.shutdownNow(); selector.wakeup(); reactorMain.awaitTermination(4, TimeUnit.SECONDS); selector.close(); LOGGER.info("Reactor stopped"); }
/** * Close the selector. This should be called when the thread is about to * exit and no operation is going to be performed on the Selector or * SelectionKey */ protected void closeSelector() { try { selector.close(); } catch (IOException e) { LOG.warn("ignored exception during selector close " + e.getMessage()); } }
@Override protected void cleanup() { try { selector.close(); } catch (IOException e) { logger.warn("Failed to close a selector.", e); } }
void close() { if (selector != null) { try { selector.close(); } catch (IOException e) { LOG.warn("Unexpected exception while closing selector : ", e); } } } }
@Override void close() { try { if (LOG.isTraceEnabled()) { LOG.trace("Doing client selector close"); } selector.close(); if (LOG.isTraceEnabled()) { LOG.trace("Closed client selector"); } } catch (IOException e) { LOG.warn("Ignoring exception during selector close", e); } }
@Override protected void cleanup() { try { selector.close(); } catch (IOException e) { logger.warn("Failed to close a selector.", e); } }
@Override protected void cleanup() { try { selector.close(); } catch (IOException e) { logger.warn("Failed to close a selector.", e); } }
/** Releases the resources used by this client, which may no longer be used. */ public void dispose () throws IOException { close(); selector.close(); }
public void close() throws IOException { if (rs.isOpen()) { rs.close(); if (sc.isOpen()) { sc.socket().shutdownInput(); sc.socket().close(); } bb = null; sc = null; } }
/** Releases the resources used by this server, which may no longer be used. */ public void dispose () throws IOException { close(); selector.close(); }
@Override public void run() { LOG.info("Starting " + Thread.currentThread().getName()); try { doRunLoop(); } finally { try { readSelector.close(); } catch (IOException ioe) { LOG.error("Error closing read selector in " + Thread.currentThread().getName(), ioe); } } }
/** * {@inheritDoc} */ @Override public void shutdown(final boolean interrupt) { super.shutdown(interrupt); try { this.serverSocketChannel.close(); this.selector.close(); } catch (IOException e) { log.error("AcceptSocketService shutdown exception", e); } }
/** * Close this selector and all associated connections */ @Override public void close() { List<String> connections = new ArrayList<>(channels.keySet()); for (String id : connections) close(id); try { this.nioSelector.close(); } catch (IOException | SecurityException e) { log.error("Exception closing nioSelector:", e); } sensors.close(); channelBuilder.close(); }
@Override protected void doClose() throws Exception { try { selector.close(); } catch (IOException e) { logger.warn("Failed to close a selector.", e); } sch.close(); }
private static void closeSelector(String selectorName, Selector selector) { try { selector.close(); } catch (IOException e) { if (logger.isWarnEnabled()) { logger.warn("Failed to close a " + selectorName + " selector.", e); } } }
@Override public void run() { try { doRunLoop(); } finally { try { readSelector.close(); } catch (IOException ioe) { LOG.error(getName() + ": error closing read selector in " + getName(), ioe); } } }
@Override public void run() { SimpleRpcServer.LOG.debug(getName() + ": starting"); try { doRunLoop(); } finally { SimpleRpcServer.LOG.info(getName() + ": stopping"); try { writeSelector.close(); } catch (IOException ioe) { SimpleRpcServer.LOG.error(getName() + ": couldn't close write selector", ioe); } } }