org.sadun.util.watchdog
Class WatchDog.BaseListener

java.lang.Object
  extended byorg.sadun.util.watchdog.WatchDog.BaseListener
All Implemented Interfaces:
WatchDog.Listener
Enclosing class:
WatchDog

public abstract static class WatchDog.BaseListener
extends java.lang.Object
implements WatchDog.Listener

A base implementation of WatchDog.Listener which invokes checkFailed() also when a check is impossible.

Listeners extending this class will need to do a type check against the received Throwable to verify wether or not is a WatchDogException(and thus represents the impossiblity of checking rather than a failed check).

Author:
Cristiano Sadun

Constructor Summary
WatchDog.BaseListener()
           
 
Method Summary
abstract  void checkFailed(java.lang.Object obj, java.lang.Throwable e)
          Receive a notification of any problem during the check.
 void checkImpossible(java.lang.Object obj, WatchDogException e)
          Invoke checkFailed()passing the received WatchDogException.
 void checkOk(java.lang.Object obj)
          Does not do anything.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WatchDog.BaseListener

public WatchDog.BaseListener()
Method Detail

checkOk

public void checkOk(java.lang.Object obj)
Does not do anything.

Specified by:
checkOk in interface WatchDog.Listener

checkFailed

public abstract void checkFailed(java.lang.Object obj,
                                 java.lang.Throwable e)
Receive a notification of any problem during the check.

The implementation will need to do a type check against the received Throwable to verify wether or not is a WatchDogException(and thus represents the impossiblity of checking rather than a failed check).

Specified by:
checkFailed in interface WatchDog.Listener
Parameters:
obj -
e -

checkImpossible

public void checkImpossible(java.lang.Object obj,
                            WatchDogException e)
Invoke checkFailed()passing the received WatchDogException.

Specified by:
checkImpossible in interface WatchDog.Listener
Parameters:
e -