|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
org.sadun.util.pool2.BasePassivationManager
org.sadun.util.pool2.DefaultPassivationManager
The default passivation manager.
This passivation manager:
Configuration storage directory to store passivated instances.
| Field Summary |
| Fields inherited from class org.sadun.util.pool2.BasePassivationManager |
logStream, monitoredPools, rotatePools, rotationRate, sleepTime |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
DefaultPassivationManager()
Constructor for DefaultPassivationManager. |
|
DefaultPassivationManager(ObjectPool pool,
java.lang.String name,
int sleepTime)
Constructor for DefaultPassivationManager. |
|
DefaultPassivationManager(java.lang.String name)
Constructor for DefaultPassivationManager. |
|
DefaultPassivationManager(java.lang.String name,
int sleepTime)
Constructor for DefaultPassivationManager. |
|
| Method Summary | |
protected void |
createState(ObjectPool pool,
PooledObject obj)
Used by a subclass to define an state information for a certain object belonging to a certain pool when a pool is added to the monitored set |
static long |
getDefaultPassivationThreshold()
Returns the defaultPassivationThreshold. |
static DefaultPassivationManager |
getInstance()
Returns the instance. |
long |
getPassivationThreshold()
Returns the passivation threshold. |
protected void |
handleAcquired(ObjectPool pool,
PooledObject obj)
This method is used by the subclass to determine what to do when a pooled object is aquired. |
protected void |
handleInvoked(ObjectPool pool,
PooledObject obj)
This method is is used by the subclass to determine what to do when a pooled object is actually invoked. |
protected void |
handleReleased(ObjectPool pool,
PooledObject obj)
This method is invoked by the pool when a pooled object is released. |
protected boolean |
isToPassivate(ObjectPool pool,
PooledObject obj,
java.lang.Object preparationResult)
This method is invoked to check whether an object is to passivate or not. |
protected java.lang.Object |
prepareForPassivationCheck(ObjectPool pool)
This method is invoked just before a pool is checked for passivation, and therefore before any isToPassivate()
is invoked.
|
protected void |
removeState(ObjectPool pool,
PooledObject obj)
Used by a subclass to remove the state information for a certain object belonging to a certain pool when a pool is removed from the monitored set |
static void |
setDefaultPassivationThreshold(long defaultPassivationThreshold)
Sets the defaultPassivationThreshold. |
void |
setPassivationThreshold(long passivationThreshold)
Sets the passivation threshold. |
| Methods inherited from class org.sadun.util.pool2.BasePassivationManager |
addPool, canPassivate, countPools, getRotationRate, getSleepTime, isRotatePools, isShuttingDown, removePool, run, setLogStream, setRotatePools, setRotationRate, setSleepTime, shutdown |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DefaultPassivationManager()
public DefaultPassivationManager(java.lang.String name)
name -
public DefaultPassivationManager(java.lang.String name,
int sleepTime)
name -
public DefaultPassivationManager(ObjectPool pool,
java.lang.String name,
int sleepTime)
pool - name - sleepTime - | Method Detail |
protected void createState(ObjectPool pool,
PooledObject obj)
BasePassivationManager
createState in class BasePassivationManagerobj - the objectpool - the pool the object belongs to
protected void removeState(ObjectPool pool,
PooledObject obj)
BasePassivationManager
removeState in class BasePassivationManagerobj - the objectpool - the pool the object belongs toBasePassivationManager.removeState(ObjectPool, PooledObject)
protected void handleInvoked(ObjectPool pool,
PooledObject obj)
BasePassivationManagerThe passivation thread may collect this information to implements its passivation policy.
handleInvoked in class BasePassivationManagerobj - the PooledObject which is being invokedBasePassivationManager.handleInvoked(org.sadun.util.pool2.ObjectPool, org.sadun.util.pool2.PooledObject)
protected boolean isToPassivate(ObjectPool pool,
PooledObject obj,
java.lang.Object preparationResult)
BasePassivationManager
isToPassivate in class BasePassivationManagerBasePassivationManager.isToPassivate(org.sadun.util.pool2.ObjectPool, org.sadun.util.pool2.PooledObject, java.lang.Object)
protected void handleAcquired(ObjectPool pool,
PooledObject obj)
BasePassivationManagerThe passivation thread may collect this information to implements its passivation policy.
handleAcquired in class BasePassivationManagerobj - the PooledObject which is being acquiredBasePassivationManager.handleAcquired(ObjectPool, PooledObject)
protected void handleReleased(ObjectPool pool,
PooledObject obj)
BasePassivationManagerThe passivation thread may collect this information to implements its passivation policy.
handleReleased in class BasePassivationManagerobj - the PooledObject which is being releasedBasePassivationManager.handleReleased(ObjectPool, PooledObject)protected java.lang.Object prepareForPassivationCheck(ObjectPool pool)
BasePassivationManagerisToPassivate()
is invoked.
A subclass may execute some preparation before the pool's
object are actually scanned, and return an object as result.
Such object is the passed to each subsequent isToPassivate() invocation.
prepareForPassivationCheck in class BasePassivationManagerpool - BasePassivationManager.prepareForPassivationCheck(ObjectPool)public static DefaultPassivationManager getInstance()
public long getPassivationThreshold()
public void setPassivationThreshold(long passivationThreshold)
passivationThreshold - The passivationThreshold to setpublic static long getDefaultPassivationThreshold()
public static void setDefaultPassivationThreshold(long defaultPassivationThreshold)
defaultPassivationThreshold - The defaultPassivationThreshold to set
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||