public class MasterComponentImplBase.DefaultResourceErrorHandler<T> extends java.lang.Object implements SubsysResourceMonitor.ResourceErrorHandler<T>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isComponent |
protected java.lang.String |
resourceName |
| Modifier | Constructor and Description |
|---|---|
protected |
DefaultResourceErrorHandler(java.lang.String resourceName,
boolean isComponent) |
| 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)
Subclasses might want to send a
reinit event to the state machine. |
boolean |
resourceUnreachable(T resource)
Called when the resource could not be reached at all because of a timeout or network/middleware communication errors.
|
protected final java.lang.String resourceName
protected final boolean isComponent
protected DefaultResourceErrorHandler(java.lang.String resourceName,
boolean isComponent)
public boolean resourceUnreachable(T resource)
SubsysResourceMonitor.ResourceErrorHandlerThe 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.
resourceUnreachable in interface SubsysResourceMonitor.ResourceErrorHandler<T>public void badState(T resource, java.lang.String stateName)
SubsysResourceMonitor.ResourceErrorHandlerSubsysResourceMonitor was found in a bad state, but still replied in time.badState in interface SubsysResourceMonitor.ResourceErrorHandler<T>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()public void resourceRecovered(T resource)
reinit event to the state machine.resourceRecovered in interface SubsysResourceMonitor.ResourceErrorHandler<T>