Package org.kiwiproject.base.process
Enum KillSignal
- java.lang.Object
-
- java.lang.Enum<KillSignal>
-
- org.kiwiproject.base.process.KillSignal
-
- All Implemented Interfaces:
Serializable,Comparable<KillSignal>
public enum KillSignal extends Enum<KillSignal>
A few common (Unix/Linux/etc) kill signals.
-
-
Field Summary
Fields Modifier and Type Field Description intsignalNumber
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringnumber()static KillSignalvalueOf(String name)Returns the enum constant of this type with the specified name.static KillSignal[]values()Returns an array containing the constants of this enum type, in the order they are declared.StringwithLeadingDash()Return this signal's number with a leading dash, e.g.static StringwithLeadingDash(String signal)Given a signal, prepend a leading dash if necessary, e.g.
-
-
-
Enum Constant Detail
-
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
-
-
Method Detail
-
values
public static KillSignal[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (KillSignal c : KillSignal.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static KillSignal valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- 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
-
-