|
Protomatter Software v1.1.7 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.protomatter.pool.SimpleObjectPool | +--com.protomatter.pool.GrowingObjectPool
An ObjectPool implementation that has an initial size and an optional max size. The pool will grow as needed by blocks until the max size is reached.
ObjectPool
,
SimpleObjectPool
Fields inherited from class com.protomatter.pool.SimpleObjectPool |
sync |
Constructor Summary | |
GrowingObjectPool()
Initialize the object pool. |
|
GrowingObjectPool(boolean monitorCheckedOutObjects)
Initialize the object pool. |
Method Summary | |
protected void |
checkinPoolObject(ObjectPoolObject o)
This method needs to be implemented by sub-classes. |
int |
getCreateWaitTime()
Get the number of milliseconds to sleep between creates of new objects for the pool. |
int |
getCurrentPoolSize()
Get the current size of the pool. |
int |
getInitialObjectPoolSize()
Get the initial size of the pool. |
int |
getMaxObjectPoolSize()
Get the maximum number of objects this pool will hold. |
protected ObjectPoolObject |
getNextPoolObject()
Gets the next object from the pool. |
int |
getObjectPoolGrowSize()
Get the number of objects the pool should grow by when it needs to grow. |
int |
getObjectPoolSize()
Get the number of objects in the pool that are available. |
protected java.util.List |
getPool()
Get the pool. |
void |
init(java.util.Map ht)
Initialize the pool. |
void |
reInitializeObjectPool()
Calls deleteObjectPoolObject() on all objects currently in the pool, and then re-creates the initial number of them. |
void |
setMaxObjectPoolSize(int size)
Change the maximum size of the object pool. |
Methods inherited from class com.protomatter.pool.SimpleObjectPool |
checkin, checkout, createObjectPoolObject, getCheckedOutObjects, getNumWaiters, getObjectsInUse, getSyncObject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GrowingObjectPool()
public GrowingObjectPool(boolean monitorCheckedOutObjects)
Method Detail |
protected java.util.List getPool()
public int getObjectPoolSize()
public int getCurrentPoolSize()
protected ObjectPoolObject getNextPoolObject() throws java.lang.Exception
getNextPoolObject
in class SimpleObjectPool
java.lang.Exception
- If there is a problem getting the next
object from the pool -- could be caused by the
createObjectPoolObject() method throwing an exception.public void setMaxObjectPoolSize(int size) throws PoolException
PoolException
- If the number of objects in use is
greater than the desired size of the pool, or if the
desired size is smaller than the initial size for
this pool.public void init(java.util.Map ht) throws java.lang.Exception
java.lang.Exception
- If there is an exception initializing the pool.public void reInitializeObjectPool() throws java.lang.Exception
java.lang.Exception
- If there is an exception re-initializing the pool.protected void checkinPoolObject(ObjectPoolObject o)
SimpleObjectPool
checkinPoolObject
in class SimpleObjectPool
SimpleObjectPool
public int getInitialObjectPoolSize()
public int getMaxObjectPoolSize()
public int getObjectPoolGrowSize()
public int getCreateWaitTime()
|
Protomatter Software v1.1.7 Copyright 1998-2002 Nate Sammons |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Protomatter Software v1.1.7 | http://protomatter.sourceforge.net/1.1.7 |