java.lang.Object javax.realtime.POSIXSignalHandler
Use instances of AsyncEventHandler
to handle POSIX signals. Usage:
POSIXSignalHandler.addHandler(SIGINT, intHandler);This class is required to be implemented only if the underlying operating system supports POSIX signals.
POSIX requires the implementation to support 13 non-real-time signals and it names 12 additional optional signals. This class mirrors that practice. Except for the 13 signals required by POSIX, support for a signal in this class does not imply that it is generated by the runtime system.
Field Summary | |
static int |
SIGABRT
Used by abort. |
static int |
SIGALRM
Alarm clock. |
static int |
SIGBUS
Bus error. |
static int |
SIGCANCEL
Deprecated. 1.0.1 This signal is not mentioned in the POSIX 9945-1-1996 standard. |
static int |
SIGCHLD
Child status change alias. |
static int |
SIGCLD
Child status change. |
static int |
SIGCONT
Stopped process has been continued. |
static int |
SIGEMT
EMT instruction. |
static int |
SIGFPE
Floating point exception. |
static int |
SIGFREEZE
Deprecated. 1.0.1 This signal is not mentioned in the POSIX 9945-1-1996 standard. |
static int |
SIGHUP
Hang-up. |
static int |
SIGILL
Illegal instruction (not reset when caught). |
static int |
SIGINT
Interrupt (rubout). |
static int |
SIGIO
Deprecated. 1.0.1 This signal is not mentioned in the POSIX 9945-1-1996 standard. |
static int |
SIGIOT
IOT instruction. |
static int |
SIGKILL
Kill (cannot be caught or ignored). |
static int |
SIGLOST
Deprecated. 1.0.1 This signal is not mentioned in the POSIX 9945-1-1996 standard. |
static int |
SIGLWP
Deprecated. 1.0.1 This signal is not mentioned in the POSIX 9945-1-1996 standard. |
static int |
SIGPIPE
Write on a pipe with no one to read it. |
static int |
SIGPOLL
Deprecated. 1.0.1 This signal is not mentioned in the POSIX 9945-1-1996 standard. |
static int |
SIGPROF
Deprecated. 1.0.1 This signal is not mentioned in the POSIX 9945-1-1996 standard. |
static int |
SIGPWR
Deprecated. 1.0.1 This signal is not mentioned in the POSIX 9945-1-1996 standard. |
static int |
SIGQUIT
Quit (ASCII FS). |
static int |
SIGSEGV
Segmentation violation. |
static int |
SIGSTOP
Stop (cannot be caught or ignored). |
static int |
SIGSYS
Bad argument to system call. |
static int |
SIGTERM
Software termination signal from kill. |
static int |
SIGTHAW
Deprecated. 1.0.1 This signal is not mentioned in the POSIX 9945-1-1996 standard. |
static int |
SIGTRAP
Trace trap. |
static int |
SIGTSTP
User stop requested from TTY. |
static int |
SIGTTIN
Background tty read attempted. |
static int |
SIGTTOU
Background tty write attempted. |
static int |
SIGURG
Deprecated. 1.0.1 This signal is not mentioned in the POSIX 9945-1-1996 standard. |
static int |
SIGUSR1
User defined signal 1. |
static int |
SIGUSR2
User defined signal 2. |
static int |
SIGVTALRM
Deprecated. 1.0.1 This signal is not mentioned in the POSIX 9945-1-1996 standard. |
static int |
SIGWAITING
Deprecated. 1.0.1 This signal is not mentioned in the POSIX 9945-1-1996 standard. |
static int |
SIGWINCH
Deprecated. 1.0.1 This signal is not mentioned in the POSIX 9945-1-1996 standard. |
static int |
SIGXCPU
Deprecated. 1.0.1 This signal is not mentioned in the POSIX 9945-1-1996 standard. |
static int |
SIGXFSZ
Deprecated. 1.0.1 This signal is not mentioned in the POSIX 9945-1-1996 standard. |
Method Summary | |
static void |
addHandler(int signal,
AsyncEventHandler handler)
Add the given AsyncEventHandler to the list of handlers of the given signal. |
static void |
removeHandler(int signal,
AsyncEventHandler handler)
Remove the given AsyncEventHandler from the list of handlers
of the given signal. |
static void |
setHandler(int signal,
AsyncEventHandler handler)
Set the given AsyncEventHandler as the handler of the given signal. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SIGABRT
public static final int SIGALRM
public static final int SIGBUS
This is an optional POSIX signal.
public static final int SIGCANCEL
public static final int SIGCHLD
public static final int SIGCLD
This is an optional POSIX signal.
public static final int SIGCONT
This is an optional POSIX signal.
public static final int SIGEMT
This is an optional POSIX signal.
public static final int SIGFPE
public static final int SIGFREEZE
public static final int SIGHUP
public static final int SIGILL
public static final int SIGINT
public static final int SIGIO
public static final int SIGIOT
This is an optional POSIX signal.
public static final int SIGKILL
public static final int SIGLOST
public static final int SIGLWP
public static final int SIGPIPE
public static final int SIGPOLL
public static final int SIGPROF
public static final int SIGPWR
public static final int SIGQUIT
public static final int SIGSEGV
public static final int SIGSTOP
This is an optional POSIX signal.
public static final int SIGSYS
This is an optional POSIX signal.
public static final int SIGTERM
public static final int SIGTHAW
public static final int SIGTRAP
This is an optional POSIX signal.
public static final int SIGTSTP
This is an optional POSIX signal.
public static final int SIGTTIN
This is an optional POSIX signal.
public static final int SIGTTOU
This is an optional POSIX signal.
public static final int SIGURG
public static final int SIGUSR1
public static final int SIGUSR2
public static final int SIGVTALRM
public static final int SIGWAITING
public static final int SIGWINCH
public static final int SIGXCPU
public static final int SIGXFSZ
Method Detail |
public static void addHandler(int signal, AsyncEventHandler handler)
AsyncEventHandler
to the list of handlers of the given signal.
signal
- One of the POSIX signals from this (e.g., this.SIGINT
). If the value given to
signal
is not one of the those defined by this class then an IllegalArgumentException
will be thrown.handler
- An AsyncEventHandler
which will be scheduled when the given signal occurs.
java.lang.IllegalArgumentException
- Thrown if signal
is not known by this class or
if handler
is null.
java.lang.UnsupportedOperationException
- Thrown if signal
is known to this class, but not supported on this
implementation.public static void removeHandler(int signal, AsyncEventHandler handler)
AsyncEventHandler
from the list of handlers
of the given signal.
signal
- One of the POSIX signals from this (e.g., this.SIGINT
). If the value given to
signal
is not one of the POSIX signals then an IllegalArgumentException
will be thrown.handler
- An AsyncEventHandler
which will be scheduled when the given signal occurs.
java.lang.IllegalArgumentException
- Thrown if signal
is not known by this class or
if handler
is null.public static void setHandler(int signal, AsyncEventHandler handler)
AsyncEventHandler
as the handler of the given signal.
signal
- One of the POSIX signals from this (e.g., this.SIGLOST
). If the value given to
signal
is not one of the POSIX signals then an IllegalArgumentException
will be thrown.handler
- An AsyncEventHandler
which will be scheduled when the given signal occurs.
If h is null then no handler will be associated with this
(i.e., remove all handlers).
java.lang.IllegalArgumentException
- Thrown if signal
is not known by this class.
java.lang.UnsupportedOperationException
- Thrown if signal
is known to this class, but not supported on this
implementation.