gr.uoa.di.madgik.grs.registry
Class LifecycleManager

java.lang.Object
  extended by java.lang.Thread
      extended by gr.uoa.di.madgik.grs.registry.LifecycleManager
All Implemented Interfaces:
java.lang.Runnable

public class LifecycleManager
extends java.lang.Thread

The LifecycleManager is a utility class that monitors the items registered with the GRSRegistry and makes sure that they are properly purged when their lifecycle properties dictates their disposal. The property that is taken into account in this decision is the last activity time of each entry. Whenever its inactivity time has extended over the timeout set for each one, the item is disposed. The timeout that is taken into account for IBuffers, is IBuffer.getInactivityTimeout() and IBuffer.getInactivityTimeUnit(). For IBufferStores, is IBufferStore.getInactivityTimeout() and IBufferStore.getInactivityTimeUnit().
The check is performed with a dynamically defined period. Initially this period is set to DefaultCheckPeriod. During each iteration, the minimum of the non to be disposed remaining lifetime is selected for both IBuffer and IBufferStore entries. At every subsequent iteration, this period is recomputed to avoid unnecessary checks

Author:
gpapanikos

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static long DefaultCheckPeriod
          The default check period.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LifecycleManager()
           
 
Method Summary
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DefaultCheckPeriod

public static final long DefaultCheckPeriod
The default check period. Currently set to 2 minutes

See Also:
Constant Field Values
Constructor Detail

LifecycleManager

public LifecycleManager()
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread