org.d_haven.mpool

Class ReflectionRecyclePolicy

public class ReflectionRecyclePolicy extends 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.
Field Summary
static Object[]EMPTY_PARAMS
static Class[]EMPTY_PARAM_DEFS
Stringm_methodName
Constructor Summary
ReflectionRecyclePolicy(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
voidrecycle(Object pooledObject)
Recycle the object included.
StringtoString()

Field Detail

EMPTY_PARAMS

private static final Object[] EMPTY_PARAMS

EMPTY_PARAM_DEFS

private static final Class[] EMPTY_PARAM_DEFS

m_methodName

private final String m_methodName

Constructor Detail

ReflectionRecyclePolicy

public ReflectionRecyclePolicy(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

Method Detail

recycle

public void recycle(Object pooledObject)
Recycle the object included. If the object is not supposed to recycle at all, then this method does nothing.

Parameters: pooledObject the object to recycle

toString

public String toString()