@Test(expected = NullPointerException.class) public void testCheckInNullHandle() throws Exception { newCache().checkIn(null); }
@Override public void checkIn(ServiceHandle<S> handle) throws Exception { checkNotNull(handle); S service = handle.getService(); ServiceEndPoint endPoint = handle.getEndPoint(); Long invalidRevision = _invalidRevisions.get(endPoint); Long serviceRevision = _checkedOutRevisions.remove(handle); if (_isClosed || (invalidRevision != null && serviceRevision < invalidRevision)) { _pool.invalidateObject(endPoint, service); } else { _pool.returnObject(endPoint, service); } }
SingleThreadedClientServiceCache implements ServiceCache<S> { @Override public void checkIn(ServiceHandle<S> handle) throws Exception { checkNotNull(handle); S service = handle.getService(); ServiceEndPoint endPoint = handle.getEndPoint(); Long invalidRevision = _invalidRevisions.get(endPoint); Long serviceRevision = _checkedOutRevisions.remove(handle); if (_isClosed || (invalidRevision != null && serviceRevision < invalidRevision)) { _pool.invalidateObject(endPoint, service); } else { _pool.returnObject(endPoint, service); } } }
SingleThreadedClientServiceCache implements ServiceCache<S> { @Override public void checkIn(ServiceHandle<S> handle) throws Exception { checkNotNull(handle); S service = handle.getService(); ServiceEndPoint endPoint = handle.getEndPoint(); Long invalidRevision = _invalidRevisions.get(endPoint); Long serviceRevision = _checkedOutRevisions.remove(handle); if (_isClosed || (invalidRevision != null && serviceRevision < invalidRevision)) { _pool.invalidateObject(endPoint, service); } else { _pool.returnObject(endPoint, service); } } 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 checkIn(ServiceHandle<S> handle) throws Exception { checkNotNull(handle); S service = handle.getService(); ServiceEndPoint endPoint = handle.getEndPoint(); Long invalidRevision = _invalidRevisions.get(endPoint); Long serviceRevision = _checkedOutRevisions.remove(handle); if (_isClosed || (invalidRevision != null && serviceRevision < invalidRevision)) { _pool.invalidateObject(endPoint, service); } else { _pool.returnObject(endPoint, service); } } 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 checkIn(ServiceHandle<S> handle) throws Exception { checkNotNull(handle); S service = handle.getService(); ServiceEndPoint endPoint = handle.getEndPoint(); Long invalidRevision = _invalidRevisions.get(endPoint); Long serviceRevision = _checkedOutRevisions.remove(handle); if (_isClosed || (invalidRevision != null && serviceRevision < invalidRevision)) { _pool.invalidateObject(endPoint, service); } else { _pool.returnObject(endPoint, service); } } 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);  }