Public Member Functions | |
abstract void | badState (T resource, String stateName) |
abstract void | resourceRecovered (T resource) |
Package Functions | |
abstract boolean | resourceUnreachable (T resource) |
Error handler that gets notified when a monitored resource becomes unavailable or degraded.
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);
.
abstract void alma.ACS.MasterComponentImpl.SubsysResourceMonitor.ResourceErrorHandler< T >.badState | ( | T | resource, | |
String | stateName | |||
) | [pure virtual] |
Called when 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, PingableResourceChecker} returns "ping() failed." which is then used as the stateName . |
Implemented in alma.ACS.MasterComponentImpl.MasterComponentImplBase.DefaultResourceErrorHandler< T >.
abstract void alma.ACS.MasterComponentImpl.SubsysResourceMonitor.ResourceErrorHandler< T >.resourceRecovered | ( | T | resource | ) | [pure virtual] |
Notification that the monitored resource has recovered after a previous failure or timeout. This notification can only work if monitoring has continued after the problem was detected, which is always the case for badState
problems, but depends on the return value of resourceUnreachable
in case of timeout. problems.
Implemented in alma.ACS.MasterComponentImpl.MasterComponentImplBase.DefaultResourceErrorHandler< T >.
abstract boolean alma.ACS.MasterComponentImpl.SubsysResourceMonitor.ResourceErrorHandler< T >.resourceUnreachable | ( | T | resource | ) | [package, pure virtual] |
Called when the resource could not be reached at all because of a timeout or network/middleware communication errors. The resource object is passed to allow using one handler for many resources.
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. Implemented in alma.ACS.MasterComponentImpl.MasterComponentImplBase.DefaultResourceErrorHandler< T >.