|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sadun.util.watchdog.listeners.WaitAndRetryListener
A listener which implements a wait/retry policy on impossible checks and sends an alarm when a failure occurs or the check couldn't be performed for a certain number of times.
Field Summary | |
static int |
DEFAULT_MAX_RETRY_COUNT
The default maximum number of retries to attempt. |
Constructor Summary | |
WaitAndRetryListener()
Create a listener which waits at most DEFAULT_MAX_RETRY_COUNT impossible
checks before declaring a failure. |
|
WaitAndRetryListener(int maxRetryCount)
Create a listener which waits the given number of impossible checks before declaring a failure. |
Method Summary | |
abstract void |
checkFailed(java.lang.Object obj,
java.lang.Throwable e)
Notifies the listener that a check has failed. |
void |
checkImpossible(java.lang.Object obj,
WatchDogException e)
Notifies the listener that a check could not be performed. |
void |
checkOk(java.lang.Object obj)
Notifies the listener that a check has been successful |
int |
getMaxRetryCount()
|
protected void |
reset()
|
void |
setMaxRetryCount(int maxRetryCount)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_MAX_RETRY_COUNT
Constructor Detail |
public WaitAndRetryListener()
DEFAULT_MAX_RETRY_COUNT
impossible
checks before declaring a failure.
public WaitAndRetryListener(int maxRetryCount)
maxRetryCount
- the max number of impossible checks before declaring a failure.Method Detail |
public void checkOk(java.lang.Object obj)
WatchDog.Listener
checkOk
in interface WatchDog.Listener
public abstract void checkFailed(java.lang.Object obj, java.lang.Throwable e)
WatchDog.Listener
checkFailed
in interface WatchDog.Listener
e
- public void checkImpossible(java.lang.Object obj, WatchDogException e)
WatchDog.Listener
checkImpossible
in interface WatchDog.Listener
e
- protected void reset()
public int getMaxRetryCount()
public void setMaxRetryCount(int maxRetryCount)
maxRetryCount
- The maxRetryCount to set.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |