public static interface SubsysResourceMonitor.ResourceErrorHandler<T>
By implementing a custom error handler, a master component can attempt first to cure the situation, or go into
ERROR state by calling doTransition(SubsystemStateEvent.SUBSYSEVENT_ERROR);.
| Modifier and Type | Method and Description |
|---|---|
void |
badState(T resource,
java.lang.String stateName)
Called when
SubsysResourceMonitor was found in a bad state, but still replied in time. |
void |
resourceRecovered(T resource)
Notification that the monitored resource has recovered after a previous failure or timeout.
|
boolean |
resourceUnreachable(T resource)
Called when the resource could not be reached at all because of a timeout or network/middleware communication errors.
|
boolean resourceUnreachable(T resource)
The return value controls whether monitoring of this resource will be stopped:
true means that the error handler decided that this resource is unreachable beyond repair,
and that no further monitoring calls should be made. This can avoid potential problems with an increasing
number of hanging calls and eventually stopping the respective threads.
false means that monitoring calls should continue.
void badState(T resource, java.lang.String stateName)
SubsysResourceMonitor was found in a bad state, but still replied in time.resource - The resource object is passed to allow using one handler for many resources.stateName - Name of the bad state the resource was found in. If the resource does not support named states,
it may return any String that indicates the problem. For example, SubsysResourceMonitor.PingableResourceChecker
returns "ping() failed." which is then used as the stateName.SubsysResourceMonitor.ResourceChecker.checkState()void resourceRecovered(T resource)
badState problems, but depends on the return value of resourceUnreachable in case of timeout.
problems.