org.edg.info
Class RetentionPeriodTracker

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.edg.info.RetentionPeriodTracker
All Implemented Interfaces:
java.lang.Runnable

public class RetentionPeriodTracker
extends java.lang.Thread

Class is used with the SP. If a retention period has been set and the SP client calls close(), the SPI is registered with this class. Periodically, a thread will check if any tuples have exceeded the retentionPeriod (for each SPI) and if so it will call the SPI's close(). Note, this class will handle any clean-up of SPI's that have been closed so no 'remove' method has been provided. Note, adding a thread to each SPI may have been easier, but this implementation uses one thread for all SPI's (so its more scalable).


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RetentionPeriodTracker(java.lang.String trackerName, InstanceTracker instanceTracker, long cleanUpInterval)
           
 
Method Summary
 void add(InstanceBase ii)
          Registers a FSPI to this tracker.
 void run()
          The thread's main loop.
 
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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RetentionPeriodTracker

public RetentionPeriodTracker(java.lang.String trackerName,
                              InstanceTracker instanceTracker,
                              long cleanUpInterval)
Method Detail

add

public void add(InstanceBase ii)
Registers a FSPI to this tracker. Once registered, a clean-up thread will periodically check it contains tuples. If no tuples are available, the FSPI is closed and removed. If the FSPI is already closed on inspection, the instance is removed.

Parameters:
ii - A FastStreamProducerInstance.

run

public void run()
The thread's main loop.