KeyedPooledObjectFactory.destroyObject

Destroy an instance no longer needed by the pool. <p> It is important for implementations of this method to be aware that there is no guarantee about what state <code>obj</code> will be in and the implementation should be prepared to handle unexpected errors. </p> <p> Also, an implementation must take in to consideration that instances lost to the garbage collector may never be destroyed. </p>

@param key the key used when selecting the instance @param p a {@code PooledObject} wrapping the instance to be destroyed

@throws Exception should be avoided as it may be swallowed by the pool implementation.

@see #validateObject @see KeyedObjectPool#invalidateObject

interface KeyedPooledObjectFactory(K, V)
void
destroyObject
(
K key
,
PooledObject!(V) p
)

Meta