Class TimeoutThread

java.lang.Object
java.lang.Thread
gov.nih.mipav.model.structures.TimeoutThread
All Implemented Interfaces:
Runnable

public class TimeoutThread extends Thread
Thread which sleeps for a pre-determined amount of time, then calls a method (if the thread hasn't had its shutdown method called). This class differs from ReminderThread because it sleeps before invoking the subscriber's callback method and because it will only invoke each subscriber's callback method once.
  • Field Details

    • subscribersHashtable

      protected Hashtable<Object,Method> subscribersHashtable
      DOCUMENT ME!
    • isRunning

      private volatile boolean isRunning
      DOCUMENT ME!
    • sleeptime

      private long sleeptime
      DOCUMENT ME!
  • Constructor Details

    • TimeoutThread

      public TimeoutThread(long sleeptime)
      Creates a new ReminderThread object.
      Parameters:
      sleeptime - DOCUMENT ME!
  • Method Details

    • addSubscriber

      public void addSubscriber(Object object, Method method)
      DOCUMENT ME!
      Parameters:
      object - DOCUMENT ME!
      method - DOCUMENT ME!
    • removeSubscriber

      public void removeSubscriber(Object object)
      DOCUMENT ME!
      Parameters:
      object - DOCUMENT ME!
    • run

      public void run()
      DOCUMENT ME!
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • shutdown

      public void shutdown()
      DOCUMENT ME!