Package org.apache.ignite.failure

## Class AbstractFailureHandler

- java.lang.Object
- - org.apache.ignite.failure.AbstractFailureHandler

- All Implemented Interfaces:
    `FailureHandler`
  Direct Known Subclasses:
    `NoOpFailureHandler`, `RestartProcessFailureHandler`, `StopNodeFailureHandler`, `StopNodeOrHaltFailureHandler`

      public abstract class AbstractFailureHandler
      extends Object
      implements FailureHandler

  Abstract superclass for `FailureHandler` implementations. Maintains a set of ignored failure types. Failure handler will not invalidate kernal context for this failures and will not handle it.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AbstractFailureHandler()` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Set<FailureType>` | `getIgnoredFailureTypes()` |
    `protected abstract boolean` | `handle​(Ignite ignite, FailureContext failureCtx)` | Actual failure handling.
    `boolean` | `onFailure​(Ignite ignite, FailureContext failureCtx)` | Handles failure occurred on `ignite` instance.
    `void` | `setIgnoredFailureTypes​(Set<FailureType> failureTypes)` | Sets failure types that must be ignored by failure handler.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractFailureHandler

          public AbstractFailureHandler()

  - ### Method Detail

    - #### setIgnoredFailureTypes

          public void setIgnoredFailureTypes​(Set<FailureType> failureTypes)

      Sets failure types that must be ignored by failure handler.
      Parameters:
        `failureTypes` - Set of failure type that must be ignored.
      See Also:
        `FailureType`

    - #### getIgnoredFailureTypes

          public Set<FailureType> getIgnoredFailureTypes()

      Returns:
        Unmodifiable set of ignored failure types.

    - #### onFailure

          public boolean onFailure​(Ignite ignite,
                                   FailureContext failureCtx)

      Handles failure occurred on `ignite` instance. Failure details is contained in `failureCtx`. Returns `true` if kernal context must be invalidated by `FailureProcessor` after calling this method.
      Specified by:
        `onFailure` in interface `FailureHandler`
      Parameters:
        `ignite` - Ignite instance.
        `failureCtx` - Failure context.
      Returns:
        Whether kernal context must be invalidated or not.

    - #### handle

          protected abstract boolean handle​(Ignite ignite,
                                            FailureContext failureCtx)

      Actual failure handling. This method is not called for ignored failure types.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`