org.apache.ignite.failure

## Class StopNodeOrHaltFailureHandler

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

- All Implemented Interfaces:
    FailureHandler

      public class StopNodeOrHaltFailureHandler
      extends AbstractFailureHandler

  Handler will try to stop node if `tryStop` value is `true`. If node can't be stopped during provided `timeout` or `tryStop` value is `false` then JVM process will be terminated forcibly using `Runtime.getRuntime().halt()`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StopNodeOrHaltFailureHandler()` Default constructor.
    `StopNodeOrHaltFailureHandler(boolean tryStop, long timeout)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `handle(Ignite ignite, FailureContext failureCtx)` Actual failure handling.
    `long` | `timeout()` Get stop node timeout.
    `String` | `toString()`
    `boolean` | `tryStop()` Get try stop.

    - ### Methods inherited from class org.apache.ignite.failure.AbstractFailureHandler

      `getIgnoredFailureTypes, onFailure, setIgnoredFailureTypes`

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

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

- - ### Constructor Detail

    - #### StopNodeOrHaltFailureHandler

          public StopNodeOrHaltFailureHandler()

      Default constructor.

    - #### StopNodeOrHaltFailureHandler

          public StopNodeOrHaltFailureHandler(boolean tryStop,
                                              long timeout)

      Parameters:
        `tryStop` - Try stop.
        `timeout` - Stop node timeout.

  - ### Method Detail

    - #### handle

          protected boolean handle(Ignite ignite,
                                   FailureContext failureCtx)

      Actual failure handling. This method is not called for ignored failure types.
      Specified by:
        `handle` in class `AbstractFailureHandler`
      See Also:
        `AbstractFailureHandler.setIgnoredFailureTypes(Set).`, `FailureHandler.onFailure(Ignite, FailureContext).`

    - #### timeout

          public long timeout()

      Get stop node timeout.
      Returns:
        Stop node timeout.

    - #### tryStop

          public boolean tryStop()

      Get try stop.
      Returns:
        Try stop.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `AbstractFailureHandler`

2021 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.11.0
Release Date | : September 11 2021