|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.osesb.objectpools.ObjectPool
public class ObjectPool
Ancestor of homogeneous object pools, which are pools that contain objects of the same type.
The framework uses the Apache Pool Package (org.apache.commons.pool) to:
| Field Summary | |
|---|---|
protected java.util.Date |
dateTimePoolStarted
The date-time when this pool was started. |
protected static int |
getObjectCount
The number of times getObject was called on this ObjectPool. |
protected long |
heartbeatInterval
The Heartbeat interval -- see run(). |
protected static int |
makeObjectCount
The number of times makeObject was called by the factory that created this object. |
protected ObjectPoolConfiguration |
poolConfiguration
The configuration for the object pool. |
protected XMLConfiguration |
pooledObjectConfiguration
The configuration for the objects in the pool. |
protected org.apache.commons.pool.impl.GenericObjectPool |
poolImplementation
The pool implementation. |
protected java.lang.String |
thisClassName
The full name of this class. |
| Constructor Summary | |
|---|---|
ObjectPool(org.apache.commons.pool.impl.GenericObjectPool poolImplementation,
ObjectPoolConfiguration poolConfiguration,
XMLConfiguration pooledObjectConfiguration)
Creates a new instance of ObjectPool. |
|
| Method Summary | |
|---|---|
void |
closePool()
Close down the pool. |
int |
getGetObjectCount()
Return getObjectCount, the number of times getObject() was called on this ObjectPool. |
int |
getMakeObjectCount()
Return makeObjectCount, the number of times MakeObject() was called by the factory that created this ObjectPool. |
java.lang.Object |
getObject()
Borrow an object from the pool. |
ObjectPoolConfiguration |
getPoolConfiguration()
Return the configuration for the pool. |
XMLConfiguration |
getPooledObjectConfiguration()
Return the configuration for the pooled object. |
void |
incrementMakeObjectCount()
Increment the counter for the number of times MakeObject() was called. |
boolean |
isPoolClosed()
Test if the pool has been closed. |
protected void |
objectPoolStartupMessage()
Startup message for ObjectPools. |
void |
returnObject(java.lang.Object object)
Return an object to the pool. |
void |
run()
Runnable interface. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String thisClassName
protected ObjectPoolConfiguration poolConfiguration
protected XMLConfiguration pooledObjectConfiguration
protected org.apache.commons.pool.impl.GenericObjectPool poolImplementation
protected long heartbeatInterval
protected java.util.Date dateTimePoolStarted
protected static int makeObjectCount
protected static int getObjectCount
| Constructor Detail |
|---|
public ObjectPool(org.apache.commons.pool.impl.GenericObjectPool poolImplementation,
ObjectPoolConfiguration poolConfiguration,
XMLConfiguration pooledObjectConfiguration)
throws java.lang.Exception
poolImplementation - A GenericObjectPool object.poolConfiguration - The configuration for the pool.pooledObjectConfiguration - The optional configuration for the pooled object.
java.lang.Exception - if a null pool implementation is passed.| Method Detail |
|---|
public java.lang.Object getObject()
throws java.lang.Exception
java.lang.Exception - if there were problems getting an object from the pool.
public void returnObject(java.lang.Object object)
throws java.lang.Exception
object - The object to return to the pool.
java.lang.Exception - if there were problems returning the object to the pool.public void closePool()
public boolean isPoolClosed()
public void incrementMakeObjectCount()
public int getGetObjectCount()
public int getMakeObjectCount()
public ObjectPoolConfiguration getPoolConfiguration()
public XMLConfiguration getPooledObjectConfiguration()
public void run()
run in interface java.lang.Runnableprotected void objectPoolStartupMessage()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||