public void close() throws Exception { httpClient.close(); }
@Override public void close() throws IOException { client.close(); } }
@Override public void close() throws IOException { delegate.close(); }
@Override protected void close(CloseableHttpAsyncClient client) throws IOException { client.close(); }
@Override public void close() throws IOException { super.close(); asyncClient.close(); httpClient.close(); }
static void close(CloseableHttpAsyncClient client) { try { Log.debug("Closing HTTP client", "client", client); client.close(); } catch (IOException e) { throw U.rte(e); } }
/** * Close the asynchronous client and its event loop. Use this method to close all the threads and allow an application to exit. */ public static void shutdown() throws IOException { // Closing the Sync HTTP client CloseableHttpClient syncClient = (CloseableHttpClient) Options.getOption(Option.HTTPCLIENT); if (syncClient != null) { syncClient.close(); } SyncIdleConnectionMonitorThread syncIdleConnectionMonitorThread = (SyncIdleConnectionMonitorThread) Options.getOption(Option.SYNC_MONITOR); if (syncIdleConnectionMonitorThread != null) { syncIdleConnectionMonitorThread.interrupt(); } // Closing the Async HTTP client (if running) CloseableHttpAsyncClient asyncClient = (CloseableHttpAsyncClient) Options.getOption(Option.ASYNCHTTPCLIENT); if (asyncClient != null && asyncClient.isRunning()) { asyncClient.close(); } AsyncIdleConnectionMonitorThread asyncMonitorThread = (AsyncIdleConnectionMonitorThread) Options.getOption(Option.ASYNC_MONITOR); if (asyncMonitorThread != null) { asyncMonitorThread.interrupt(); } }
@Override public void close() throws IOException { ac.close(); } };
@Override public void close() throws IOException { delegate.close(); } }
@Override protected void closeDelegate() throws IOException { apacheHttpClient.close(); }
/** * Close the wrapped {@link CloseableHttpAsyncClient} */ public void close() throws IOException { httpclient.close(); }
private static void shutdown(CloseableHttpAsyncClient client) { try { client.close(); } catch (IOException e1) { e1.printStackTrace(); } }
/** * 关闭client对象 * * @param client */ private static void close(final CloseableHttpAsyncClient client) { try { client.close(); } catch (IOException e) { logger.error(e); } }
private void close() { try { closeableHttpAsyncClient.close(); } catch (IOException e) { e.printStackTrace(); } } }
@Override public void destroy() throws Exception { callbackExecutor.shutdown(); nonCachingHttpClient.close(); }
@Override public void close() throws IOException { super.close(); asyncClient.close(); httpClient.close(); }
@Override public void failed(final Exception ex) { try { callback.failed(ex); } finally { try { client.close(); } catch (final IOException e) { logger.log(Level.WARNING, "Cannot close client", e); } } }
@Override protected void close() { HttpFactory.IdleConnectionMonitor.getInstance().removeConnMgr(connManager); if (this.httpClient != null && this.httpClient instanceof CloseableHttpAsyncClient) { try { ((CloseableHttpAsyncClient) httpClient).close(); clientIsOpen = false; } catch (IOException e) { // quietly } } }
@Override public Stream<Exception> close() { return Util.collectExceptions(Util.tryCast(client, CloseableHttpAsyncClient.class) .filter(c -> c.isRunning()) .map(c -> Util.tryDo(c, d -> d.close())) .filter(c -> c.isPresent()) .map(c -> c.get()), Util.tryDo(manager, m -> m.shutdown()), Util.tryDo(syncMonitor, m -> m.interrupt())); } }
public void shutdown() { try { this.connEvictor.shutdown(); this.connEvictor.join(); this.httpClient.close(); } catch (IOException e) { throw new ClientException("Failed to shutdown http client.", e); } catch (InterruptedException e) { // ignore exception } } }