Package com.microstrategy.web.platform
Class ThreadRegistry
- java.lang.Object
-
- com.microstrategy.web.platform.ThreadRegistry
-
public class ThreadRegistry extends java.lang.Object
This class maintains a simple running/terminating status, tracks threads and timers created by the application, and ensures they are properly cleaned up when we terminate.
-
-
Constructor Summary
Constructors Constructor Description ThreadRegistry()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ThreadRegistry
getInstance()
boolean
isTerminating()
Returns whether application is terminating.void
register(java.lang.Thread thread)
Registers thread.void
register(java.util.Timer timer)
void
terminate()
Interrupts all registered threads, and cancels timers.
-
-
-
Method Detail
-
getInstance
public static ThreadRegistry getInstance()
-
register
public void register(java.lang.Thread thread)
Registers thread. Please ensure thread can be terminated with an interrupt, i.e. interrupts should not be caught and ignored. When interrupted, the thread should proceed to clean itself up and terminate.
-
register
public void register(java.util.Timer timer)
-
isTerminating
public boolean isTerminating()
Returns whether application is terminating. Will only return true ifterminate()
was invoked.
-
terminate
public void terminate()
Interrupts all registered threads, and cancels timers. This is normally triggered from an application controller when its shutdown.
-
-