com.ibm.tivoli.oslc.util.timedresource

Class TimedResourceMap.Terminator

  • java.lang.Object
    • com.ibm.tivoli.oslc.util.timedresource.TimedResourceMap.Terminator
  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    TimedResourceMap


    public class TimedResourceMap.Terminator
    extends java.lang.Object
    implements java.lang.Runnable
    Thread that monitors a TimedResourceMap and removes members (@link SelfTerminatingValue) that have reached their life expectancy
    • Constructor Detail

      • Terminator

        public Terminator(boolean startWorkerThread)
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • isThreadRunning

        public boolean isThreadRunning()
      • stopTerminating

        public void stopTerminating()
        Stop this worker thread. The thread will no longer track the map after it stops.
      • startWorkerThread

        public void startWorkerThread()
        Start this worker thread. This method checks if the thread is already running.
      • setTerminationInterval

        public void setTerminationInterval(long terminationInterval)
      • getTerminatorInterval

        public int getTerminatorInterval()
        Get the interval in which an object will live in the map before it is removed.
        Returns:
        The time in seconds.
      • setLifespan

        public void setLifespan(long lifespan)
      • getLifespan

        public int getLifespan()