|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.orderlysoftware.orderlycalls.base.ObjectPool
public class ObjectPool
This class is used by the framework to pool objects for increased performance.
You should consider pooling your own objects - please see the example code for examples of how to pool AGIProcessors and ManagerEventListeners.
Constructor Summary | |
---|---|
ObjectPool()
|
Method Summary | |
---|---|
static java.lang.Object |
find(java.lang.Class c)
Alternative method for pooling objects that do not have a zero-argument constructor. |
static void |
free(java.lang.Object o)
Returns an object to the pool. |
static java.lang.Object |
getInstance(java.lang.Class c)
Pooled objects MUST have a no-argument constructor to work with this method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectPool()
Method Detail |
---|
public static java.lang.Object getInstance(java.lang.Class c)
c
- the class of the object to get.
public static java.lang.Object find(java.lang.Class c)
This method does NOT instantiate objects if none can be found.
c
- the class of the object to find.
public static void free(java.lang.Object o)
You MUST call this method when you have finished with your object if it is to be reused.
You SHOULD ensure that all non-static member fields of your object have been reset before calling this method.
You CAN pool objects that have not been created with getInstance().
o
- the object to return to the pool.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |