|
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.LimitedPooler
Wraps another Pooler class to limit the objects fetched by the pool. If the number of objects being pooled needs to be capped at a certain value (because of resource restrictions, eg: only 10 database connections allowed), use this class to prevent a pool from fetching or creating more objects than allowed.
| Constructor Summary | |
LimitedPooler(Pooler pool,
int max)
Caps the Pooler specified to only allow a maximum number of objects out of the pool at any one time. |
|
| Method Summary | |
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 |
| Constructor Detail |
public LimitedPooler(Pooler pool,
int max)
pool - - the Pooler to wrapmax - - the maximum number of objects allowed out of pool| 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.public void release(java.lang.Object o)
Pooler
release in interface Poolero - the objectpublic void close()
Pooler
close in interface PoolerPooler.close()
|
PooliT v2.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||