Package gov.nih.mipav.model.structures
Class TimeoutThread
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.structures.TimeoutThread
- All Implemented Interfaces:
Runnable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanDOCUMENT ME!private longDOCUMENT ME!DOCUMENT ME!Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSubscriber(Object object, Method method) DOCUMENT ME!voidremoveSubscriber(Object object) DOCUMENT ME!voidrun()DOCUMENT ME!voidshutdown()DOCUMENT ME!Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
subscribersHashtable
DOCUMENT ME! -
isRunning
private volatile boolean isRunningDOCUMENT ME! -
sleeptime
private long sleeptimeDOCUMENT ME!
-
-
Constructor Details
-
TimeoutThread
public TimeoutThread(long sleeptime) Creates a new ReminderThread object.- Parameters:
sleeptime- DOCUMENT ME!
-
-
Method Details