IrqHandler (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.service.launcher, class: IrqHandler

Package org.apache.hadoop.service.launcher

# Class IrqHandler

java.lang.Object
org.apache.hadoop.service.launcher.IrqHandler

All Implemented Interfaces:
  `SignalUtil.Handler`

@Private @Unstable public final class IrqHandler extends Object implements SignalUtil.Handler
Handler of interrupts that relays them to a registered implementation of `IrqHandler.Interrupted`. This class bundles up all the compiler warnings about abuse of sun.misc interrupt handling code into one place.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `IrqHandler.InterruptData`
  Interrupt data to pass on.
  `static interface`
  `IrqHandler.Interrupted`
  Callback issues on an interrupt.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `CONTROL_C`
  Definition of the Control-C handler name: "INT".
  `static final String`
  `SIGTERM`
  Definition of default `kill` signal: "TERM".

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IrqHandler(String name, IrqHandler.Interrupted handler)`
  Create an IRQ handler bound to the specific interrupt.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `bind()`
  Bind to the interrupt handler.
  `String`
  `getName()`
  `int`
  `getSignalCount()`
  Get the count of how many times a signal has been raised.
  `void`
  `handle(SignalUtil.Signal s)`
  Handler for the JVM API for signal handling.
  `void`
  `raise()`
  Raise the signal.
  `String`
  `toString()`

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

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

- ## Field Details

  - ### CONTROL_C

    public static final String CONTROL_C
    Definition of the Control-C handler name: "INT".
    See Also:
      - Constant Field Values

  - ### SIGTERM

    public static final String SIGTERM
    Definition of default `kill` signal: "TERM".
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### IrqHandler

    public IrqHandler(String name, IrqHandler.Interrupted handler)
    Create an IRQ handler bound to the specific interrupt.
    Parameters:
      `name` - signal name
      `handler` - handler

- ## Method Details

  - ### bind

    public void bind()
    Bind to the interrupt handler.
    Throws:
      `IllegalArgumentException` - if the exception could not be set

  - ### getName

    public String getName()
    Returns:
      the signal name.

  - ### raise

    public void raise()
    Raise the signal.

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### handle

    public void handle(SignalUtil.Signal s)
    Handler for the JVM API for signal handling.
    Specified by:
      `handle` in interface `SignalUtil.Handler`
    Parameters:
      `s` - signal raised

  - ### getSignalCount

    public int getSignalCount()
    Get the count of how many times a signal has been raised.
    Returns:
      the count of signals