|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.ThreadGroup tyrex.services.DaemonMaster
The daemon master is responsible for starting, terminating and restarting daemon thread.
A daemon thread is a thread that is kept live for the duration of the server's life and is only terminated when the server is stopped.
A sudden termination of a daemon thread is an unwelcome occurance in the life time of the system. The daemon master protects the system from the sudden and unexpected termination of daemons by automatically restarting them.
A daemon implements the Runnable interface which allows it to be executed on any given thread. The daemon master assigns a thread within the daemon master's thread group. If the daemon is suddently terminated, the daemon master will be informed and attempt to restart the daemon with a new thread.
The daemon master is thread-safe and consumes a single thread.
Field Summary |
Fields inherited from class java.lang.ThreadGroup |
|
Method Summary | |
static void |
addDaemon(java.lang.Runnable runnable,
java.lang.String name)
Adds a daemon. |
static void |
addDaemon(java.lang.Runnable runnable,
java.lang.String name,
int priority)
Adds a daemon. |
static void |
dump(java.io.PrintWriter writer)
|
static int |
getCount()
Returns the number of daemons currently in the system. |
static boolean |
removeDaemon(java.lang.Runnable runnable)
Removes a daemon. |
void |
run()
|
void |
uncaughtException(java.lang.Thread thread,
java.lang.Throwable thrw)
|
Methods inherited from class java.lang.ThreadGroup |
activeCount, activeGroupCount, allowThreadSuspension, checkAccess, destroy, enumerate, enumerate, enumerate, enumerate, getMaxPriority, getName, getParent, interrupt, isDaemon, isDestroyed, list, parentOf, resume, setDaemon, setMaxPriority, stop, suspend, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public static int getCount()
public static void addDaemon(java.lang.Runnable runnable, java.lang.String name)
runnable
- The runnable objectname
- The daemon namepublic static void addDaemon(java.lang.Runnable runnable, java.lang.String name, int priority)
runnable
- The runnable objectname
- The daemon namepriority
- The thread prioritypublic static boolean removeDaemon(java.lang.Runnable runnable)
runnable
- The runnable objectpublic static void dump(java.io.PrintWriter writer)
public void uncaughtException(java.lang.Thread thread, java.lang.Throwable thrw)
public void run()
run
in interface java.lang.Runnable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |