org.d_haven.mpool

Interface PoolListener

public interface PoolListener

The PoolListener interface provides a couple intercept points as well as a way to find out when an object fails to be disposed properly.
Method Summary
voidobjectAquired(Object pooledObject)
Notifies the listener when an object is being accessed from the pool.
voidobjectCreated(Object pooledObject)
Notifies the listener when the pool creates a new object to introduce into the pool.
voidobjectCreationFailed(Exception cause)
Notifies the listener when the pool fails to create a new object when it is asked for.
voidobjectDisposalFailed(Object pooledObject, Exception exception)
Notifies the listener when an object disposal failed.
voidobjectDisposed(Object pooledObject)
Notifies the listener when an object is being disposed so that it will never be reused.
voidobjectReleased(Object pooledObject)
Notifies the listener when an object is being returned to the pool.

Method Detail

objectAquired

public void objectAquired(Object pooledObject)
Notifies the listener when an object is being accessed from the pool. This is the last method called before returning the pooled object to the caller.

Parameters: pooledObject the object being returned from the caller

objectCreated

public void objectCreated(Object pooledObject)
Notifies the listener when the pool creates a new object to introduce into the pool.

Parameters: pooledObject the object created

objectCreationFailed

public void objectCreationFailed(Exception cause)
Notifies the listener when the pool fails to create a new object when it is asked for.

Parameters: cause the exception that caused the failure

objectDisposalFailed

public void objectDisposalFailed(Object pooledObject, Exception exception)
Notifies the listener when an object disposal failed.

Parameters: pooledObject the object that could not be disposed exception the exception generated from the disposal

objectDisposed

public void objectDisposed(Object pooledObject)
Notifies the listener when an object is being disposed so that it will never be reused.

Parameters: pooledObject the object being disposed

objectReleased

public void objectReleased(Object pooledObject)
Notifies the listener when an object is being returned to the pool. This is the last method called before returning the pooled object to the pool.

Parameters: pooledObject the object being returned to the pool