private void close() { client.connectionPool().evictAll(); // Close any persistent connections. }
@Override public void shutdown() { executorService.shutdown(); client.connectionPool().evictAll(); }
@Override public void close() { httpClient.dispatcher().executorService().shutdown(); httpClient.connectionPool().evictAll(); }
@Override public void close() { httpClient.dispatcher().executorService().shutdown(); httpClient.connectionPool().evictAll(); }
public void close() { client.dispatcher().executorService().shutdown(); client.connectionPool().evictAll(); }
EventListener eventListener = realChain.eventListener(); StreamAllocation streamAllocation = new StreamAllocation(client.connectionPool(), createAddress(request.url()), call, eventListener, callStackTrace); this.streamAllocation = streamAllocation; streamAllocation = new StreamAllocation(client.connectionPool(), createAddress(followUp.url()), call, eventListener, callStackTrace); this.streamAllocation = streamAllocation;
EventListener eventListener = realChain.eventListener(); StreamAllocation streamAllocation = new StreamAllocation(client.connectionPool(), createAddress(request.url()), call, eventListener, callStackTrace); this.streamAllocation = streamAllocation; streamAllocation = new StreamAllocation(client.connectionPool(), createAddress(followUp.url()), call, eventListener, callStackTrace); this.streamAllocation = streamAllocation;
httpClient.connectionPool().evictAll();
public static boolean isHttpsAvailable(Config config) { Config sslConfig = new ConfigBuilder(config) .withMasterUrl(Config.HTTPS_PROTOCOL_PREFIX + config.getMasterUrl()) .withRequestTimeout(1000) .withConnectionTimeout(1000) .build(); OkHttpClient client = HttpClientUtils.createHttpClient(config); try { Request request = new Request.Builder().get().url(sslConfig.getMasterUrl()) .build(); Response response = client.newCall(request).execute(); try (ResponseBody body = response.body()) { return response.isSuccessful(); } } catch (Throwable t) { LOG.warn("SSL handshake failed. Falling back to insecure connection."); } finally { if (client != null && client.connectionPool() != null) { client.connectionPool().evictAll(); } } return false; }
@Override public void close() { ConnectionPool connectionPool = httpClient.connectionPool(); Dispatcher dispatcher = httpClient.dispatcher(); ExecutorService executorService = httpClient.dispatcher() != null ? httpClient.dispatcher().executorService() : null; if (dispatcher != null) { dispatcher.cancelAll(); } if (connectionPool != null) { connectionPool.evictAll(); } Utils.shutdownExecutorService(executorService); }
@Override public void shutdown() { executorService.shutdown(); client.connectionPool().evictAll(); }
@Override @InterfaceAudience.Private public void evictAllConnectionsInPool() { if (client != null) { ConnectionPool pool = client.connectionPool(); if (pool != null) pool.evictAll(); } }
@Override public void destroy() { if (destroyed.compareAndSet(false, true)) { client.dispatcher().executorService().shutdown(); client.connectionPool().evictAll(); } }
@PreDestroy public void destroy() { if(okHttpClient != null) { okHttpClient.dispatcher().executorService().shutdown(); okHttpClient.connectionPool().evictAll(); } }
@PreDestroy public void destroy() { if(okHttpClient != null) { okHttpClient.dispatcher().executorService().shutdown(); okHttpClient.connectionPool().evictAll(); } }
@PreDestroy public void destroy() { if(okHttpClient != null) { okHttpClient.dispatcher().executorService().shutdown(); okHttpClient.connectionPool().evictAll(); } } }
@PreDestroy public void destroy() { if(httpClient != null) { httpClient.dispatcher().executorService().shutdown(); httpClient.connectionPool().evictAll(); } } }
@Override public void close() { client.connectionPool().evictAll(); client.dispatcher().executorService().shutdown(); } }
@Override public void close() { httpClient.dispatcher().executorService().shutdown(); httpClient.connectionPool().evictAll(); }
private void closeExecutor(OkHttpClient client, boolean force) { client.dispatcher().cancelAll(); if (force) { client.connectionPool().evictAll(); ExecutorService executorService = client.dispatcher().executorService(); executorService.shutdown(); } }