Pool Class
- public class Pool
extends Object
A generic object pooling class.
-
Hierarchy
-
Object
Pool
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Pool
public Pool(PoolMemberFactory
factory,
int size)
- Standard constructor.
getInstance() Method
public Object
getInstance()
Provide a free member of the pool. Mark the member as in use.
Returns
- the free pool member
returnInstance(Object) Method
public void returnInstance(Object
memberObject)
Return a member of the pool to available status.
Parameters
-
memberObject
- the object to return