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 and Description
    `AbstractFailureHandler()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<FailureType>` | `getIgnoredFailureTypes()` Returns unmodifiable set of ignored failure types.
    `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.
      See Also:
        `setIgnoredFailureTypes(Set).`, `FailureHandler.onFailure(Ignite, FailureContext).`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020