@Override public void close() throws IOException { checkNotNull(client, "Factory not initialized. You probably forgot to call init()!"); client.close(); connManager.close(); }
public void shutdown() throws InterruptedException, IOException { log.info("Shutting down client pool"); // Signal the stop to the thread. Stop stop = new Stop(); stopSignal.add(stop); // Wait for the stop to complete. stop.waitForStopped(); // Close the pool - Added Singleton.Client.threadSafeClient.close(); // Close the connection manager. cm.close(); log.info("Client pool shut down"); }
/** * Stop the HttpClient and Manager. * * @throws IOException */ private void stop() throws IOException { client.close(); manager.close(); }
public void destroy() { if (poolingManager != null) { poolingManager.close(); poolingBuilderMappings.remove(this.poolingName); } }
@Override public void close() throws IOException { client.close(); connManager.close(); }
public synchronized void close() { if (client != null) { try { client.close(); } catch (IOException e) { // in case of a problem or the connection was aborted } client = null; } if (connMgr != null) { connMgr.close(); connMgr = null; } } }
@Override protected void doCloseOpenOutputs() { try { httpClient.close(); connectionManager.close(); } catch (IOException ex) { log.error("Error attempting to close HttpOutputWriter: ", ex); } }
public synchronized void close() { if (client != null) { try { client.close(); } catch (IOException e) { // in case of a problem or the connection was aborted } client = null; } if (connMgr != null) { connMgr.close(); connMgr = null; } } }
public void close() { try { if (_httpClient != null) { _httpClient.close(); } if (_cm != null) { _cm.close(); } } catch (IOException e) { e.printStackTrace(); } } }
@Override public void close() throws IOException { checkNotNull(client, "Factory not initialized. You probably forgot to call init()!"); client.close(); connManager.close(); }
public void shutdown() { try { pool.close(); } catch (Exception ex) { log.error("Error shutting down the NodeAccessor for druid {}", ExceptionUtils.getStackTrace(ex)); } }
@Override public void close() throws IOException { super.close(); this.connManager.close(); } }
public void shutdown() { try { pool.close(); } catch (Exception ex) { log.error("Error shutting down the NodeAccessor for druid {}", ExceptionUtils.getStackTrace(ex)); } }
connManager.close();
connManager.close();
/** * Close the asynchronous client and its event loop. Use this method to close all the threads and allow an application to exit. */ @Override public void close() { try { if (syncClient != null) { syncClient.close(); syncConnectionManager.close(); } if (asyncClient != null && asyncClient.isRunning()) { asyncClient.close(); } } catch (Exception ex) { throw new RuntimeException(ex); } ClientContainer.removeClient(this); }
@Override public Stream<Exception> close() { return Util.collectExceptions(Util.tryCast(client, CloseableHttpClient.class) .map(c -> Util.tryDo(c, Closeable::close)) .filter(Optional::isPresent) .map(Optional::get), Util.tryDo(manager, m -> m.close()), Util.tryDo(syncMonitor, i -> i.interrupt()) ); }
@Override public Stream<Exception> close() { return Util.collectExceptions(Util.tryCast(client, CloseableHttpClient.class) .map(c -> Util.tryDo(c, Closeable::close)) .filter(Optional::isPresent) .map(Optional::get), Util.tryDo(manager, m -> m.close()), Util.tryDo(syncMonitor, i -> i.interrupt()) ); }