com.codestudio.util
Class GenericPool
java.lang.Object
|
+--com.codestudio.util.ObjectPool
|
+--com.codestudio.util.GenericPool
- All Implemented Interfaces:
- Pool, java.io.Serializable
- public class GenericPool
- extends ObjectPool
GenericPool allows any object to be pooled through the PoolManager.
By passing a classname and optionally some constructor params, any
Java object can be pooled here and accessed through a PoolManager.
- See Also:
- Serialized Form
Field Summary |
protected java.lang.reflect.Constructor |
con
|
protected java.lang.Object[] |
oparams
|
protected java.lang.Class |
otype
|
Constructor Summary |
GenericPool(GenericPoolMetaData metad,
java.lang.String classname,
java.lang.Object[] params)
Create a pool of Objects in which the Objects are created using
a specific constructor with the specified params. |
GenericPool(PoolMetaData metad)
Create a pool of Objects in which the Objects are created using
the default empty constructor. |
Method Summary |
protected java.lang.Object |
create()
|
protected void |
expire(java.lang.Object o)
Default expiration invokes PooledObject.closeAllResources() |
protected java.lang.reflect.Constructor |
figureConstructor()
|
java.lang.Object[] |
getParams()
Get the constructor's params |
java.lang.Object |
requestObject()
Subclasses will usually want to override this method. |
void |
returnObject(java.lang.Object o)
Subclasses will usually want to override this method, at least
for type safety. |
void |
setParams(java.lang.Object[] p)
Set the constructor's params |
protected boolean |
validate(java.lang.Object o)
|
Methods inherited from class com.codestudio.util.ObjectPool |
checkIn, checkOut, checkTimeout, cleanUp, closeAllResources, debug, debug, debugMetrics, finalize, getPoolname, init, log, log, numCheckedInObjects, numCheckedOutObjects, numTotalObjects, updateLocked |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
otype
protected java.lang.Class otype
oparams
protected java.lang.Object[] oparams
con
protected java.lang.reflect.Constructor con
GenericPool
public GenericPool(PoolMetaData metad)
- Create a pool of Objects in which the Objects are created using
the default empty constructor.
GenericPool
public GenericPool(GenericPoolMetaData metad,
java.lang.String classname,
java.lang.Object[] params)
- Create a pool of Objects in which the Objects are created using
a specific constructor with the specified params.
setParams
public void setParams(java.lang.Object[] p)
- Set the constructor's params
getParams
public java.lang.Object[] getParams()
- Get the constructor's params
figureConstructor
protected java.lang.reflect.Constructor figureConstructor()
create
protected java.lang.Object create()
throws java.lang.Exception
- Overrides:
create
in class ObjectPool
requestObject
public java.lang.Object requestObject()
- Description copied from class:
ObjectPool
- Subclasses will usually want to override this method.
- Overrides:
requestObject
in class ObjectPool
returnObject
public void returnObject(java.lang.Object o)
- Description copied from class:
ObjectPool
- Subclasses will usually want to override this method, at least
for type safety.
- Overrides:
returnObject
in class ObjectPool
validate
protected boolean validate(java.lang.Object o)
- Overrides:
validate
in class ObjectPool
expire
protected void expire(java.lang.Object o)
- Description copied from class:
ObjectPool
- Default expiration invokes
PooledObject.closeAllResources()
- Overrides:
expire
in class ObjectPool
Copyright © 1999-2001 The Code Studio. All Rights Reserved.