org.d_haven.mpool
public final class FixedSizePool extends AbstractPool
Pool
that caches Poolable objects for reuse.
Please note that this pool offers no resource limiting whatsoever.
Version: CVS $Revision: 1.11 $ $Date: 2004/06/21 17:03:46 $
Field Summary | |
---|---|
List | m_buffer |
boolean | m_disposed |
long | m_stepTime |
long | m_timeout |
Constructor Summary | |
---|---|
FixedSizePool(ObjectFactory factory, int size)
Create a fixed size pool using the object factory and size
supplied. | |
FixedSizePool(ObjectFactory factory, int size, long timeout)
Create a fixed size pool using the object factory, size, and
timeout supplied. |
Method Summary | |
---|---|
void | dispose()
Dispose this pool and remove all elements. |
protected Object | doAcquire() |
protected boolean | doRelease(Object object) |
long | getTimeout()
Get the timeout in milliseconds for this pool.
|
Object | popLast() |
String | toString() |
Parameters: factory the factory to use for the pool size the number of items in the pool (hard limit)
Throws: Exception if there is a problem creating any of the items in the pool
Parameters: factory the factory to use for the pool size the number of items in the pool (hard limit) timeout the timeout in milliseconds to use.
Throws: Exception if there is a problem creating any of the items in the pool
Returns: the timeout in milliseconds