Class MonitoredThread.MultiThreadMonitor
java.lang.Object
org.eclipse.net4j.util.concurrent.MonitoredThread.MultiThreadMonitor
- All Implemented Interfaces:
Runnable
,MonitoredThread.ThreadMonitor
- Enclosing class:
- MonitoredThread
public static class MonitoredThread.MultiThreadMonitor
extends Object
implements MonitoredThread.ThreadMonitor, Runnable
- Author:
- Eike Stepper
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMultiThreadMonitor
(long timeOut) Same as calling MonitoredThread(idleTimeOut, SYNCED_START).MultiThreadMonitor
(long idleTimeOut, long startOffset) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addThread
(MonitoredThread thread) long
void
handleFinished
(MonitoredThread thread) void
handleStarting
(MonitoredThread thread) protected void
void
run()
-
Field Details
-
SYNCED_START
public static final long SYNCED_START- See Also:
-
-
Constructor Details
-
MultiThreadMonitor
public MultiThreadMonitor(long idleTimeOut, long startOffset) - Parameters:
idleTimeOut
- The number of milli seconds one of the threads may be idle (i.e. not having calledMonitoredThread.heartBeat()
) beforehandleTimeoutExpiration(MonitoredThread)
is called.startOffset
- The number of milli seconds to sleep between threads are started. Zero means not to sleep andSYNCED_START
means that all threads start at the same time by waiting on a shared latch.
-
MultiThreadMonitor
public MultiThreadMonitor(long timeOut) Same as calling MonitoredThread(idleTimeOut, SYNCED_START).
-
-
Method Details
-
getIdleTimeOut
public long getIdleTimeOut() -
addThread
-
handleStarting
- Specified by:
handleStarting
in interfaceMonitoredThread.ThreadMonitor
-
handleFinished
- Specified by:
handleFinished
in interfaceMonitoredThread.ThreadMonitor
-
run
public void run() -
handleTimeoutExpiration
-