bb.util
Interface ThreadMonitorListener

All Known Implementing Classes:
ThreadMonitor.UnitTest.ListenerTest

public interface ThreadMonitorListener

Interface for receiving events from ThreadMonitor.

As with typical listener classes, implementations should also catch and handle any Throwables generated inside these methods since ThreadMonitor has little idea how to handle them.

Implementations should be multithread safe, since ThreadMonitor makes no guarantee which thread(s) will call these methods.

Author:
Brent Boyer

Method Summary
 void onDeadlocked(String state)
          Called whenever the associated ThreadMonitor instance first detects deadlock when previously it had detected no deadlock.
 void onMonitoringError(Throwable t)
          Called when the associated ThreadMonitor instance has detected some error while monitoring.
 void onMonitoringStarted()
          Called when the associated ThreadMonitor instance has just started monitoring.
 void onMonitoringStopped()
          Called when the associated ThreadMonitor instance has just stopped monitoring.
 void onNotDeadlocked(String state)
          Called whenever the associated ThreadMonitor instance first detects no deadlock when previously it had detected deadlock.
 void onThreadState(String state)
          Called whenever the associated ThreadMonitor instance has measured a new thread state.
 

Method Detail

onMonitoringStarted

void onMonitoringStarted()
Called when the associated ThreadMonitor instance has just started monitoring. This method will be called repeatedly if ThreadMonitor goes thru multiple start and stop cycles.


onMonitoringStopped

void onMonitoringStopped()
Called when the associated ThreadMonitor instance has just stopped monitoring. This method will be called repeatedly if ThreadMonitor goes thru multiple start and stop cycles.


onMonitoringError

void onMonitoringError(Throwable t)
Called when the associated ThreadMonitor instance has detected some error while monitoring.

Parameters:
t - the Throwable which caused the error

onThreadState

void onThreadState(String state)
Called whenever the associated ThreadMonitor instance has measured a new thread state. This method will be called repeatedly.

Parameters:
state - the entire thread state which was just measured

onDeadlocked

void onDeadlocked(String state)
Called whenever the associated ThreadMonitor instance first detects deadlock when previously it had detected no deadlock. This method will be called repeatedly if the JVM cycles in and out of deadlock.

Parameters:
state - the thread state of just the deadlocked threads

onNotDeadlocked

void onNotDeadlocked(String state)
Called whenever the associated ThreadMonitor instance first detects no deadlock when previously it had detected deadlock. This method will be called repeatedly if the JVM cycles in and out of deadlock.

Parameters:
state - the entire thread state which was just measured