/** * Attempt to tear down the client connection. * The connection will be closed if the following conditions hold: * 1. There are no active user holding the client. * 2. The client has been evicted from the cache. */ public synchronized void tearDownIfUnused() { if (users.get() != 0) { LOG.warn("Non-zero user count preventing client tear down: users=" + users.get() + " expired=" + expiredFromCache); } if (users.get() == 0 && expiredFromCache) { this.tearDown(); } }
/** * GC is attempting to destroy the object. * No one references this client anymore, so it can be torn down without worrying about user counts. * @throws Throwable */ @Override protected void finalize() throws Throwable { if (users.get() != 0) { LOG.warn("Closing client with non-zero user count: users=" + users.get() + " expired=" + expiredFromCache); } try { this.tearDown(); } finally { super.finalize(); } } }
/** * Attempt to tear down the client connection. * The connection will be closed if the following conditions hold: * 1. There are no active user holding the client. * 2. The client has been evicted from the cache. */ public synchronized void tearDownIfUnused() { if (users.get() != 0) { LOG.warn("Non-zero user count preventing client tear down: users=" + users.get() + " expired=" + expiredFromCache); } if (users.get() == 0 && expiredFromCache) { this.tearDown(); } }
/** * GC is attempting to destroy the object. * No one references this client anymore, so it can be torn down without worrying about user counts. * @throws Throwable */ @Override protected void finalize() throws Throwable { if (users.get() != 0) { LOG.warn("Closing client with non-zero user count: users=" + users.get() + " expired=" + expiredFromCache); } try { this.tearDown(); } finally { super.finalize(); } } }
/** * Tear down only if * 1. There are no active user * 2. It has expired from the cache */ public void tearDownIfUnused() { if (users.get() == 0 && expiredFromCache) { this.tearDown(); } }
/** * Tear down only if * 1. There are no active user * 2. It has expired from the cache */ public void tearDownIfUnused() { if (users.get() == 0 && expiredFromCache) { this.tearDown(); } }
/** * Last effort to clean up, may not even get called. * @throws Throwable */ @Override protected void finalize() throws Throwable { try { this.tearDown(); } finally { super.finalize(); } } }
/** * Last effort to clean up, may not even get called. * @throws Throwable */ @Override protected void finalize() throws Throwable { try { this.tearDown(); } finally { super.finalize(); } } }
/** * Last effort to clean up, may not even get called. * @throws Throwable */ @Override protected void finalize() throws Throwable { try { this.tearDown(); } finally { super.finalize(); } } }
/** * Tear down only if * 1. There are no active user * 2. It has expired from the cache */ public void tearDownIfUnused() { if (users.get() == 0 && expiredFromCache) { this.tearDown(); } }