setInterval Method (ThreadMonitor Class)

In FileNet P8 4.0.0 and later, this method is utilized during monitoring of a background thread.

The setInterval method may be called by a background thread to modify the current value of the ThreadMonitor object interval parameter, which is the maximum number of milliseconds within which the background thread must ping the ThreadMonitor in order to be considered alive and well. When a value greater than zero is specified, the ThreadMonitor resets time counting for measuring the elapsed time between pings from the thread, and uses the new time interval. If the disable method had previously been called to stop monitoring of the background thread, monitoring of the thread is enabled again by using the new time interval.

When zero is specified, the ThreadMonitor stops watching the clock to verify whether pings from the thread are received within the specified time interval. This is the equivalent of calling the disable Method.

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

Syntax
void setInterval(int newInterval);
Parameters
newInterval - [in] Required int value that provides the new maximum number of milliseconds within which the background thread must ping the ThreadMonitor in order to be considered alive and well.
Example
Listener listener = new Listener("sampleApp", "4.0");
/* Create a monitored background thread that will
 * ping the ThreadMonitor at least every 15 seconds */
ThreadMonitor thread_one;
thread_one = listener.threadMonitorFactory("Background Thread 1", 15000);
...
/* During process execution, disable monitoring of the thread */
thread_one.disable();
...
/* During process execution, reset the interval to 30 seconds
 * and resume monitoring of the background thread */
thread_one.setInterval(30000);
...
See Also
ThreadMonitor Class
threadMonitorFactory Method
ping Method
disable Method
getInterval Method