org.d_haven.mpool
Class ReflectionRecyclePolicy
java.lang.Object
org.d_haven.mpool.ReflectionRecyclePolicy
- All Implemented Interfaces:
- RecyclePolicy
public class ReflectionRecyclePolicy
- extends java.lang.Object
- implements RecyclePolicy
The ReflectionRecyclePolicy allows the user to specify a particular
method to use for recycling their pooled objects regardless of
whether the object implements any interfaces or not.
Constructor Summary |
ReflectionRecyclePolicy(java.lang.String methodName)
Create the ReflectionRecyclePolicy using the supplied method name
as the magic method that gets called when an object is returned
to the pool. |
Method Summary |
void |
recycle(java.lang.Object pooledObject)
Recycle the object included. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
m_methodName
private final java.lang.String m_methodName
EMPTY_PARAM_DEFS
private static final java.lang.Class[] EMPTY_PARAM_DEFS
EMPTY_PARAMS
private static final java.lang.Object[] EMPTY_PARAMS
ReflectionRecyclePolicy
public ReflectionRecyclePolicy(java.lang.String methodName)
- Create the ReflectionRecyclePolicy using the supplied method name
as the magic method that gets called when an object is returned
to the pool.
- Parameters:
methodName
- the name of the method to call
recycle
public void recycle(java.lang.Object pooledObject)
- Recycle the object included. If the object is not supposed to
recycle at all, then this method does nothing.
- Specified by:
recycle
in interface RecyclePolicy
- Parameters:
pooledObject
- the object to recycle
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object