@Test public void testMultipleClose() { SingleThreadedClientServiceCache<Service> cache = newCache(); cache.close(); cache.close(); }
@Override public void close() { _isClosed = true; if (_evictionFuture != null) { _evictionFuture.cancel(false); } try { _pool.close(); } catch(Exception e) { LOG.error("Error closing pool", e); } _metrics.close(); }
SingleThreadedClientServiceCache implements ServiceCache<S> { @Override public void close() { _isClosed = true; if (_evictionFuture != null) { _evictionFuture.cancel(false); } try { _pool.close(); } catch(Exception e) { LOG.error("Error closing pool", e); } _metrics.close(); } }
SingleThreadedClientServiceCache implements ServiceCache<S> { @Override public void close() { _isClosed = true; if (_evictionFuture != null) { _evictionFuture.cancel(false); } try { _pool.close(); } catch(Exception e) { LOG.error("Error closing pool", e); } _metrics.close(); } SingleThreadedClientServiceCache(ServiceCachingPolicy policy, ServiceFactory<S> serviceFactory, MetricRegistry metrics); @VisibleForTesting  SingleThreadedClientServiceCache(ServiceCachingPolicy policy, ServiceFactory<S> serviceFactory, ScheduledExecutorService executor,
                                     MetricRegistry metrics); }
SingleThreadedClientServiceCache implements ServiceCache<S> { @Override public void close() { _isClosed = true; if (_evictionFuture != null) { _evictionFuture.cancel(false); } try { _pool.close(); } catch(Exception e) { LOG.error("Error closing pool", e); } _metrics.close(); } SingleThreadedClientServiceCache(ServiceCachingPolicy policy, ServiceFactory<S> serviceFactory, MetricRegistry metrics); @VisibleForTesting  SingleThreadedClientServiceCache(ServiceCachingPolicy policy, ServiceFactory<S> serviceFactory, ScheduledExecutorService executor,
                                     MetricRegistry metrics); ServiceHandle<S> checkOut(ServiceEndPoint endPoint); @Override void checkIn(ServiceHandle<S> handle); @Override int getNumIdleInstances(ServiceEndPoint endPoint); @Override int getNumActiveInstances(ServiceEndPoint endPoint); @Override void close(); @Override void register(ServiceEndPoint endPoint); @Override void evict(ServiceEndPoint endPoint); }
SingleThreadedClientServiceCache implements ServiceCache<S> { @Override public void close() { _isClosed = true; if (_evictionFuture != null) { _evictionFuture.cancel(false); } try { _pool.close(); } catch(Exception e) { LOG.error("Error closing pool", e); } _metrics.close(); } SingleThreadedClientServiceCache(ServiceCachingPolicy policy, ServiceFactory<S> serviceFactory, MetricRegistry metrics); @VisibleForTesting  SingleThreadedClientServiceCache(ServiceCachingPolicy policy, ServiceFactory<S> serviceFactory, ScheduledExecutorService executor,
                                     MetricRegistry metrics); ServiceHandle<S> checkOut(ServiceEndPoint endPoint); @Override void checkIn(ServiceHandle<S> handle); @Override int getNumIdleInstances(ServiceEndPoint endPoint); @Override int getNumActiveInstances(ServiceEndPoint endPoint); @Override void close(); @Override void register(ServiceEndPoint endPoint); @Override void evict(ServiceEndPoint endPoint);  }