@Override public void close() throws IOException { this.endpoint.close(); }
public void close(final boolean isFinalize) { try { if (isFinalize) { clientEndpoint.closeAsync(); } else { clientEndpoint.close(); } } catch (IOException e) { throw new RuntimeException("Failed to release endpoint", e); } } });
@Override public void shutdown() { try { endpoint.close(); } catch (IOException e) { } } });
public void release(final CacheKey endpointHash, final boolean async) { Endpoint toClose; synchronized (this) { final CacheEntry cacheEntry = cache.get(endpointHash); if (cacheEntry.referenceCount.decrementAndGet() == 0) { try { toClose = cacheEntry.endpoint; } finally { cache.remove(endpointHash); } } else { return; } } if (async) { toClose.closeAsync(); } else { try { toClose.close(); } catch (IOException e) { throw new RuntimeException("Failed to close endpoint", e); } } }
@Override public void shutdown() { try { endpoint.close(); } catch (IOException e) { } } });
@Override public void close() throws IOException { this.endpoint.close(); }
@Override public void close() throws IOException { if(destroyExecutor) { executorService.shutdown(); } if(endpoint != null) try { endpoint.close(); } catch (IOException e) { // ignore } if(destroyExecutor) { executorService.shutdownNow(); } }
@Override public void close() throws IOException { if(destroyExecutor) { executorService.shutdown(); } if(endpoint != null) try { endpoint.close(); } catch (IOException | UnsupportedOperationException e) { // ignore } if(destroyExecutor) { executorService.shutdownNow(); } }
public void close() throws IOException { log.trace("close()"); closed = true; final ShutDownHook shutDownHook; if ((shutDownHook = this.shutDownHook) != null) { Runtime.getRuntime().removeShutdownHook(shutDownHook); this.shutDownHook = null; } channel.writeShutdown(); channel.close(); endpoint.close(); }
public synchronized void close() { try { if (connection != null) { connection.close(); } } catch (IOException e) { AppClientLogger.ROOT_LOGGER.exceptionClosingConnection(e); } try { if (endpoint != null) { endpoint.close(); } } catch (IOException e) { AppClientLogger.ROOT_LOGGER.exceptionClosingConnection(e); } } }