|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.osesb.objectpools.KeyedObjectPool
public class KeyedObjectPool
Ancestor of heterogeneous object pools, which are pools that contain objects of different types.
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 int |
getObjectCount
The number of times getObject was called on this ObjectPool. |
protected long |
heartbeatInterval
The Heartbeat interval -- see run(). |
protected KeyedObjectPoolConfiguration |
keyedObjectPoolConfiguration
The pool configuration as a whole including the ObjectPoolConfiguration and the pooled object configuration(s). |
protected 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, which is part of keyedObjectPoolConfiguration, but is extracted for convenience. |
protected org.apache.commons.pool.impl.GenericKeyedObjectPool |
poolImplementation
The pool implementation. |
protected java.lang.String |
thisClassName
The full name of this class. |
| Constructor Summary | |
|---|---|
KeyedObjectPool(org.apache.commons.pool.impl.GenericKeyedObjectPool poolImplementation,
KeyedObjectPoolConfiguration keyedObjectPoolConfiguration)
Creates a new instance of KeyedObjectPool. |
|
| Method Summary | |
|---|---|
void |
closePool()
Close down the pool. |
int |
getGetObjectCount()
Return getObjectCount, the number of times getObject() was called on this ObjectPool. |
KeyedObjectPoolConfiguration |
getKeyedObjectPoolConfiguration()
Return the pool configuration as a whole including the ObjectPoolConfiguration* and the pooled object configuration(s). |
int |
getMakeObjectCount()
Return makeObjectCount, the number of times MakeObject() was called by the factory that created this ObjectPool. |
java.lang.Object |
getObject(java.lang.Object poolKey)
Borrow an object from the pool by poolKey. |
java.lang.Object |
getObject(java.lang.String poolKey)
Borrow an object from the pool by poolKey. |
ObjectPoolConfiguration |
getPoolConfiguration()
Return the configuration for the pool. |
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 poolKey,
java.lang.Object object)
Return an object to the pool. |
void |
returnObject(java.lang.String poolKey,
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 KeyedObjectPoolConfiguration keyedObjectPoolConfiguration
protected ObjectPoolConfiguration poolConfiguration
protected org.apache.commons.pool.impl.GenericKeyedObjectPool poolImplementation
protected long heartbeatInterval
protected java.util.Date dateTimePoolStarted
protected int makeObjectCount
protected int getObjectCount
| Constructor Detail |
|---|
public KeyedObjectPool(org.apache.commons.pool.impl.GenericKeyedObjectPool poolImplementation,
KeyedObjectPoolConfiguration keyedObjectPoolConfiguration)
throws java.lang.Exception
poolImplementation - A GenericKeyedObjectPool object.keyedObjectPoolConfiguration - The configuration for the pool
and the pooled objects.
java.lang.Exception - if incorrect parameters are passed.| Method Detail |
|---|
public java.lang.Object getObject(java.lang.String poolKey)
throws java.lang.Exception
poolKey - The key for one of the object types in the pool as a String.
java.lang.Exception - if there was an error getting an object from the pool.
public java.lang.Object getObject(java.lang.Object poolKey)
throws java.lang.Exception
poolKey - The key for one of the object types in the pool.
java.lang.Exception - if there was an error getting an object from the pool.
public void returnObject(java.lang.String poolKey,
java.lang.Object object)
throws java.lang.Exception
poolKey - The key for one of the object types in the pool as a String.object - The object to return to the pool.
java.lang.Exception - if there was an error returning an object to the pool.
public void returnObject(java.lang.Object poolKey,
java.lang.Object object)
throws java.lang.Exception
poolKey - The key for one of the object types in the pool.object - The object to return to the pool.
java.lang.Exception - if there was an error returning an object to the pool.public void closePool()
public boolean isPoolClosed()
public void incrementMakeObjectCount()
public int getGetObjectCount()
public int getMakeObjectCount()
public ObjectPoolConfiguration getPoolConfiguration()
public KeyedObjectPoolConfiguration getKeyedObjectPoolConfiguration()
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 | ||||||||