org.d_haven.mpool
Interface PoolListener

All Known Implementing Classes:
PoolAdaptor

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
 void objectAquired(java.lang.Object pooledObject)
          Notifies the listener when an object is being accessed from the pool.
 void objectCreated(java.lang.Object pooledObject)
          Notifies the listener when the pool creates a new object to introduce into the pool.
 void objectCreationFailed(java.lang.Exception cause)
          Notifies the listener when the pool fails to create a new object when it is asked for.
 void objectDisposalFailed(java.lang.Object pooledObject, java.lang.Exception exception)
          Notifies the listener when an object disposal failed.
 void objectDisposed(java.lang.Object pooledObject)
          Notifies the listener when an object is being disposed so that it will never be reused.
 void objectReleased(java.lang.Object pooledObject)
          Notifies the listener when an object is being returned to the pool.
 

Method Detail

objectCreated

public void objectCreated(java.lang.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(java.lang.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

objectAquired

public void objectAquired(java.lang.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

objectReleased

public void objectReleased(java.lang.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

objectDisposed

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

Parameters:
pooledObject - the object being disposed

objectDisposalFailed

public void objectDisposalFailed(java.lang.Object pooledObject,
                                 java.lang.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


Copyright © 2004-2007 D-Haven.org. All Rights Reserved.