IBM FileNet P8, Version 5.2            

Tracking Background Threads

In FileNet® P8 4.0.0 and later, a facility is available to aid in monitoring background threads. The facility allows a background thread to be associated with a ThreadMonitor object, which is used to enable monitoring of the thread through the use of a ping mechanism. When monitoring of a background thread is enabled, the ThreadMonitor facility starts to keep track of the clock. The background thread must ping the ThreadMonitor at least every N milliseconds (less than N is fine, but more than N is too late). If the thread fails to ping the ThreadMonitor within N milliseconds, then the thread is assumed to have died, and the ThreadMonitor sends a critical message about the thread.

ThreadMonitor objects are created at the top level of the Listener by calling the threadMonitorFactory method of the Listener object.

ThreadMonitor myThreadMonitor = listener.threadMonitorFactory(message, interval);

The message is a Unicode String that may contain any printable characters, excluding the newline character, which provides the custom message to associate with the monitored background thread. The interval is an int value that specifies the number of milliseconds within which the background thread must contact the ThreadMonitor through the use of the ping method. If a thread fails to ping the ThreadMonitor within the specified time interval, then the message is automatically broadcast by the ThreadMonitor as a CRITICAL level message.

Changing the Interval Value

When a ThreadMonitor is first created, the maximum number of milliseconds within which the background thread must ping the ThreadMonitor is specified in the interval parameter. If the value is set to zero at creation time, monitoring of the background thread is initially disabled. 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.

Disabling Thread Monitoring

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. When monitoring is disabled, the ThreadMonitor does not watch the clock to verify whether pings from the thread are received within the specified interval of milliseconds. Once monitoring has been disabled, it can be enabled again by specifying an interval value greater than zero through the use of the setInterval method.



Feedback

Last updated: October 2013
p8plj018.htm

© Copyright IBM Corporation 2014.
This information center is powered by Eclipse technology. (http://www.eclipse.org)