Enum Class KillSignal

java.lang.Object
java.lang.Enum<KillSignal>
org.kiwiproject.base.process.KillSignal
All Implemented Interfaces:
Serializable, Comparable<KillSignal>, Constable

public enum KillSignal extends Enum<KillSignal>
A few common (Unix/Linux/etc) kill signals.
  • Enum Constant Details

    • SIGHUP

      public static final KillSignal SIGHUP
      Hang up signal, e.g. kill -1
    • SIGINT

      public static final KillSignal SIGINT
      Interrupt signal, e.g. kill -2
    • SIGQUIT

      public static final KillSignal SIGQUIT
      Quit signal, e.g. kill -3
    • SIGKILL

      public static final KillSignal SIGKILL
      Non-catchable, non-ignorable kill signal, e.g. kill -9
    • SIGTERM

      public static final KillSignal SIGTERM
      Software termination signal, e.g. kill -15
  • Field Details

    • signalNumber

      public final int signalNumber
  • Method Details

    • values

      public static KillSignal[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static KillSignal valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • number

      public String number()
      Returns:
      the number associated with this signal.
    • withLeadingDash

      public static String withLeadingDash(String signal)
      Given a signal, prepend a leading dash if necessary, e.g. change "9" into "-9".
      Parameters:
      signal - the signal to modify
      Returns:
      the possibly modified signal with a leading dash
    • withLeadingDash

      public String withLeadingDash()
      Return this signal's number with a leading dash, e.g. "-3".
      Returns:
      this instance of signal's number with a leading dash