getInterval Method (ThreadMonitor Class)

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

The getInterval method may be called by a background thread to query 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 monitoring of the background thread has been disabled, either by setting the interval to zero or through the use of the disable method, this method returns zero.

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

Syntax
int getInterval();
Parameters
None.
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, determine the current interval */
int currInterval = thread_one.getInterval();
/* Examine the interval */
...
/* 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
setInterval Method