|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Instance pool holds a number if instances that can be borrowed from the pool. Once an instance has been acquired it must be returned to the pool by calling release, which puts the instance back into the pool, or by calling remove, which marks the instance as no longer used but does not put it back in the pool. An implementation will have to refill the pool as entries are removed.
Method Summary | |
Object |
acquire()
Get an instance from the pool. |
boolean |
release(Object instance)
Releases the hold on the instance. |
void |
remove(Object instance)
Drop an instance permanently from the pool. |
Method Detail |
public Object acquire() throws InterruptedException, Exception
InterruptedException
- if pool is using hard limits and thread was interrupted
while waiting for an instance to become available
Exception
- if object demand object construction was required and
an error occured during constructionpublic boolean release(Object instance)
instance
- the instance to return to the pool
public void remove(Object instance)
instance
- the instance to discard
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |