/
SignalType.java
58 lines (52 loc) · 1.27 KB
/
SignalType.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package com.laytonsmith.PureUtilities;
/**
* The interface for various signal types. See {@link Signals} for various default implementations.
*/
public interface SignalType {
/**
* Returns the default action of the signal.
*
* @return
*/
DefaultAction getDefaultAction();
/**
* Some signals are not catchable. If this returns true, this is one of those signals.
*
* @return
*/
boolean isCatchable();
/**
* Returns the signal name, as required by the JVM.
*
* @return
*/
String getSignalName();
/**
* A default action is the action that a signal will have if it is ignored.
*/
public static enum DefaultAction {
/**
* Abnormal termination of the process. The process is terminated with all the consequences of _exit() except
* that the status made available to wait() and waitpid() indicates abnormal termination by the specified
* signal.
*/
TERMINATE,
/**
* Abnormal termination of the process. Additionally, implementation-defined abnormal termination actions, such
* as creation of a core file, may occur.
*/
ACTION_TERMINATE,
/**
* Ignore the signal.
*/
IGNORE,
/**
* Stop the process.
*/
STOP,
/**
* Continue the process, if it is stopped; otherwise, ignore the signal.
*/
CONTINUE;
}
}