org.d_haven.mpool
public final class VariableSizePool extends AbstractPool implements ManagablePool
Pool
that caches Poolable objects for reuse.
Please note that this pool offers no resource limiting whatsoever.
Version: CVS $Revision: 1.9 $ $Date: 2004/06/21 17:03:46 $
Field Summary | |
---|---|
LinkedList | m_buffer |
boolean | m_disposed |
Constructor Summary | |
---|---|
VariableSizePool(ObjectFactory factory, int size)
Create a VariableSizePool with the supplied factory and initial
size.
|
Method Summary | |
---|---|
void | dispose()
Dispose of this pool so that it is empty an no longer used. |
protected Object | doAcquire() |
protected boolean | doRelease(Object pooledObject) |
void | grow(int byNum) |
Object | popLast() |
void | shrink(int byNum) |
int | size() |
String | toString() |
Parameters: factory the factory to use to create objects size the initial number of elements to create
Throws: Exception if there is a problem creating the pooled objects