/** * Uninstalls the cache and releases any active resources. Stored contents will remain on the * filesystem. */ public void close() throws IOException { delegate.close(); }
@Override public void destroy() throws IOException { if (this.defaultClient) { // Clean up the client if we created it in the constructor Cache cache = this.client.cache(); if (cache != null) { cache.close(); } this.client.dispatcher().executorService().shutdown(); } }
@Override public void destroy() throws IOException { if (this.defaultClient) { // Clean up the client if we created it in the constructor Cache cache = this.client.cache(); if (cache != null) { cache.close(); } this.client.dispatcher().executorService().shutdown(); } }
/** Stops this instance from accepting further requests. */ public void shutdown() { if (shutdown) { return; } cache.clear(); stats.shutdown(); dispatcher.shutdown(); if (closeableCache != null) { try { closeableCache.close(); } catch (IOException ignored) { } } for (DeferredRequestCreator deferredRequestCreator : targetToDeferredRequestCreator.values()) { deferredRequestCreator.cancel(); } targetToDeferredRequestCreator.clear(); shutdown = true; }
@Override public void shutdown() { if (cache != null) { try { cache.close(); } catch (IOException ignored) { } } } }
@Override public void shutdown() { if (cache != null) { try { cache.close(); } catch (IOException ignored) { } } } }
/** * Uninstalls the cache and releases any active resources. Stored contents will remain on the * filesystem. */ public void close() throws IOException { delegate.close(); }
@Override public void shutdown() { try { Cache cache = client.cache(); if (cache != null) { cache.flush(); cache.close(); } } catch (IOException e) { logger.error("Error while trying shutdown OpenTSDB publisher", e); } }
@Override public void destroy() throws IOException { if (this.defaultClient) { // Clean up the client if we created it in the constructor Cache cache = this.client.cache(); if (cache != null) { cache.close(); } this.client.dispatcher().executorService().shutdown(); } }
@Override public void destroy() throws IOException { if (this.defaultClient) { // Clean up the client if we created it in the constructor Cache cache = this.client.cache(); if (cache != null) { cache.close(); } this.client.dispatcher().executorService().shutdown(); } }
private static void closeOkHttpClient(@NotNull OkHttpClient client) { client.dispatcher().executorService().shutdown(); client.connectionPool().evictAll(); final Cache cache = client.cache(); if (cache != null) { try { cache.close(); } catch (IOException ignored) { } } }
@Override public void destroy() throws IOException { // Clean up the client if we created it in the constructor try { if (this.client.cache() != null) { this.client.cache().close(); } this.client.dispatcher().executorService().shutdown(); } catch (NullPointerException e) { //Ignore } }
private static void shutdown(OkHttpClient client) throws IOException { client.dispatcher().executorService().shutdown(); client.connectionPool().evictAll(); final Cache cache = client.cache(); if (cache != null) { cache.close(); } } }
@Override public void release() { if ( client == null ) return; try { released = true; client.dispatcher().executorService().shutdownNow(); } finally { try { if ( client.cache() != null ) client.cache().close(); } catch (IOException e) { throw new MarkLogicIOException(e); } finally { client = null; logger.debug("Releasing connection"); } } }
@Override public void close() throws IOException { if (this.client.dispatcher() != null && this.client.dispatcher().executorService() != null) { this.client.dispatcher().executorService().shutdown(); } if (this.client.connectionPool() != null) { this.client.connectionPool().evictAll(); } if (this.client.cache() != null) { this.client.cache().close(); } }
/** * Closes aggressively a OkHttpClient according to the OkHttpClient documentation. * * @param okHttpClient the OkHttpClient. */ public static void closeOkHttpClient(OkHttpClient okHttpClient) { if (okHttpClient.dispatcher() != null && okHttpClient.dispatcher().executorService() != null) { okHttpClient.dispatcher().executorService().shutdown(); } if (okHttpClient.connectionPool() != null) { okHttpClient.connectionPool().evictAll(); } if (okHttpClient.cache() != null) { try { okHttpClient.cache().close(); } catch (IOException e) { throw new SpongeException(e); } } } }