ThreadMonitor Class

The ThreadMonitor object is created by a Listener object to monitor a background thread. Each object is created with an associated custom message String and an int time interval.

When monitoring of a background thread is enabled, the ThreadMonitor facility starts to watch the clock. The background thread must contact the ThreadMonitor through the use of the ping method within the specified time interval (milliseconds). Less than interval milliseconds is fine, but more than interval milliseconds is too late. If a thread fails to ping the ThreadMonitor within the specified time interval, then the thread is assumed to have died, and the message is automatically broadcast by the ThreadMonitor as a CRITICAL level message.

During process execution, the value of the interval may be modified by the application using the setInterval method or retrieved using the getInterval method. When the value of interval is set to greater than zero, monitoring of the background thread is enabled. Monitoring of the background thread can be disabled at any time using the disable method, or by setting the interval value of the ThreadMonitor to zero.

For more information about monitoring background threads, see Tracking Background Threads.

Constructor
threadMonitorFactory Method - Creates a ThreadMonitor object.
Methods
ping - Used by the thread to make contact with the System Manager.
disable - Disables monitoring of the thread.
getInterval - Obtains the current time interval within which the thread must ping the ThreadMonitor.
setInterval - Modifies the time interval within which the thread must ping the ThreadMonitor.
See Also
Listener Class