|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.service.perfmonitor.PerformancePool
public class PerformancePool
This class manages pools of objects. In an effort to mimimize object creation during performance monitoring, this class precreates a pool of objects.
This class does not keep track of busy objects, it is up to the user of a borrowed object to return it to the pool.
To use this class, you supply the full name of an object to construct it and call getObject() to retrieve and object and returnObject to return it to the pool.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
Constructor Summary | |
---|---|
PerformancePool(java.lang.String pClassName,
int pInitialSize)
Constructs a PerformancePool object and populates it with objects of a given type |
Method Summary | |
---|---|
java.lang.Object |
createObject()
Constructs an object of a given type. |
java.lang.Object |
getObject()
Returns an object from the pool to the caller. |
void |
returnObject(java.lang.Object pObject)
Returns an object back into the pool for later use. |
boolean |
validateObjectType(java.lang.Object pObject)
Validates that an object is of a certain type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public PerformancePool(java.lang.String pClassName, int pInitialSize) throws java.lang.ClassNotFoundException
pInitialSize
- the initial size of the pool.
java.lang.ClassNotFoundException
Method Detail |
---|
public java.lang.Object createObject() throws java.lang.InstantiationException, java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.IllegalAccessException
public boolean validateObjectType(java.lang.Object pObject)
pObject
- the object to validate the type ofpublic java.lang.Object getObject()
public void returnObject(java.lang.Object pObject)
pObject
- the object to return back to the pool
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |