bb.util
Class ThreadMonitor.MonitorTask

java.lang.Object
  extended by java.util.TimerTask
      extended by bb.util.ThreadMonitor.MonitorTask
All Implemented Interfaces:
Runnable
Enclosing class:
ThreadMonitor

private class ThreadMonitor.MonitorTask
extends TimerTask

Class which detects thread issues and calls the appropriate fireXXX event notification method.

This class is not multithread safe: it expects to be run by only a single thread.


Field Summary
private  ThreadMeasurer measurer
          ThreadMeasurer used to measure the thread state.
 
Constructor Summary
private ThreadMonitor.MonitorTask(ThreadMeasurer measurer)
          Constructor.
 
Method Summary
 void run()
          Detects any thread issues and calls the appropriate fireXXX event notification method.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

measurer

private final ThreadMeasurer measurer
ThreadMeasurer used to measure the thread state.

Contract: is never null.

Constructor Detail

ThreadMonitor.MonitorTask

private ThreadMonitor.MonitorTask(ThreadMeasurer measurer)
                           throws IllegalArgumentException
Constructor.

Throws:
IllegalArgumentException - if measurer == null
Method Detail

run

public void run()
Detects any thread issues and calls the appropriate fireXXX event notification method.

If any Throwable is caught: it is logged by the logger2, fireOnMonitoringError is called, and then stopMonitoring is called.

Specified by:
run in interface Runnable
Specified by:
run in class TimerTask