public class

ThreadMonitor

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.concurrent.ThreadMonitor

Class Overview

This class is used to monitor the execution of a target thread. That target thread thread can be forcefully stopped after a dynamic timeout has elapsed. The target thread should check for and respect interruption requests (details). The monitor itself can be executed as a separate thread.

Summary

Nested Classes
enum ThreadMonitor.State  
Public Constructors
ThreadMonitor(Thread thread, boolean started, IMonitorInfoProvider moninfo, Runnable before, Runnable after)
Create a new thread monitor instance.
Public Methods
Thread getMonitoredThread()
synchronized ThreadMonitor.State getState()
synchronized boolean isMonitoring()
synchronized boolean isReady()
synchronized boolean isTerminated()
synchronized Thread start(boolean blocking)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ThreadMonitor (Thread thread, boolean started, IMonitorInfoProvider moninfo, Runnable before, Runnable after)

Create a new thread monitor instance.

Parameters
thread the thread to be monitored, started or not
started false if the thread was not started by the caller, in which case it will be started right before monitoring takes place
moninfo information for the monitor
before optional routine run before monitoring occurs
after optional routine run after monitoring is done

Public Methods

public Thread getMonitoredThread ()

public synchronized ThreadMonitor.State getState ()

public synchronized boolean isMonitoring ()

public synchronized boolean isReady ()

public synchronized boolean isTerminated ()

public synchronized Thread start (boolean blocking)