|
PooliT v2.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ascentphase.poolit.poolers.NotifierPooler
Notifies listeners who are interested in knowing when objects are being fetched and released. Classes wishing to be notified must implement the NotifierPoolListener interface and be registered with this Pooler by calling the addListener() method. Listeners' fetched() method is called after the underlying Poolers fetch() is called. The listeners' released() method is called before the underlying Poolers release() method is called. This Pooler wraps another Pooler that implements the actual pooling algorithm.
| Field Summary | |
protected java.util.Collection |
listeners
|
protected Pooler |
pool
|
| Constructor Summary | |
NotifierPooler(Pooler p)
|
|
| Method Summary | |
void |
addListener(NotifierPoolListener listener)
Adds a listener to this Pooler to be notified when objects are fetched and released. |
void |
close()
Releases all objects in the pool and any resources held by these objects. |
java.lang.Object |
fetch()
Retrieves an object from the pool. |
void |
release(java.lang.Object o)
Returns an object to the pool. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Pooler pool
protected java.util.Collection listeners
| Constructor Detail |
public NotifierPooler(Pooler p)
| Method Detail |
public java.lang.Object fetch()
throws FetchException
Pooler
fetch in interface PoolerFetchException - if the pooler is unable to return an object from
the pool.Pooler.fetch()public void release(java.lang.Object o)
Pooler
release in interface Poolero - the objectPooler.release(java.lang.Object)public void close()
Pooler
close in interface PoolerPooler.close()public void addListener(NotifierPoolListener listener)
listener - a NotifierPoolListener to be notified of Pooler events.
|
PooliT v2.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||