|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object AbstractPool
AbstractPool implements the Pool interface and serves as an abstract
base class for all resource pools. A derived class should override
the createResource
and deleteResource
methods.
Constructor Summary | |
AbstractPool(int size)
Construct a AbstractPool of the specified size. |
Method Summary | |
boolean |
active()
Returns true if this pool is active. |
Object |
allocate(boolean waitFlag)
Allocate a resource from the pool. |
int |
available()
Return the number of available resources. |
void |
release(Object o)
Release a resource and return it to the pool. |
void |
start()
Start allocating resources. |
String |
statistics()
|
void |
stop()
Stop allocating resources and release all resources in the pool. |
Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractPool(int size)
size
- the maximum size of the pool.Method Detail |
public boolean active()
active
in interface Pool
public Object allocate(boolean waitFlag) throws PoolException
allocate
in interface Pool
waitFlag
- true if method should wait for an available resource.
PoolException
public int available()
available
in interface Pool
public void release(Object o)
release
in interface Pool
o
- the resource to be released.public void start()
start
in interface Pool
public void stop()
stop
in interface Pool
public String statistics()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |