javax.realtime
Class POSIXSignalHandler

java.lang.Object
  |
  +--javax.realtime.POSIXSignalHandler

public final class POSIXSignalHandler
extends java.lang.Object

Use instances of AsyncEvent 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.


Field Summary
static int SIGABRT
          Used by abort, replace SIGIOT in the future.
static int SIGALRM
          Alarm clock.
static int SIGBUS
          Bus error.
static int SIGCANCEL
          Thread cancellation signal used by libthread.
static int SIGCHLD
          Child status change alias (POSIX).
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
          Special signal used by CPR.
static int SIGHUP
          Hangup.
static int SIGILL
          Illegal instruction (not reset when caught).
static int SIGINT
          Interrupt (rubout).
static int SIGIO
          Socket I/O possible (SIGPOLL alias).
static int SIGIOT
          IOT instruction.
static int SIGKILL
          Kill (cannot be caught or ignored).
static int SIGLOST
          Resource lost (e.g., record-lock lost).
static int SIGLWP
          Special signal used by thread library.
static int SIGPIPE
          Write on a pipe with no one to read it.
static int SIGPOLL
          Pollable event occurred.
static int SIGPROF
          Profiling timer expired.
static int SIGPWR
          Power-fail restart.
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
          Special signal used by CPR.
static int SIGTRAP
          Trace trap (not reset when caught).
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
          Urgent socket condition.
static int SIGUSR1
          User defined signal = 1.
static int SIGUSR2
          User defined signal = 2.
static int SIGVTALRM
          Virtual timer expired.
static int SIGWAITING
          Process's lwps are blocked.
static int SIGWINCH
          Window size change.
static int SIGXCPU
          Exceeded cpu limit.
static int SIGXFSZ
          Exceeded file size limit.
 
Constructor Summary
POSIXSignalHandler()
           
 
Method Summary
static void addHandler(int signal, AsyncEventHandler handler)
          Add the given AsyncEventHandler to the list of handlers of the AsyncEvent of the given signal.
static void removeHandler(int signal, AsyncEventHandler handler)
          Remove the given AsyncEventHandler to the list of handlers of the AsyncEvent of the given signal.
static void setHandler(int signal, AsyncEventHandler handler)
          Set the given AsyncEventHandler as the handler of the AsyncEvent of the given signal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIGHUP

public static final int SIGHUP
Hangup.

SIGINT

public static final int SIGINT
Interrupt (rubout).

SIGQUIT

public static final int SIGQUIT
Quit (ASCII FS).

SIGILL

public static final int SIGILL
Illegal instruction (not reset when caught).

SIGTRAP

public static final int SIGTRAP
Trace trap (not reset when caught).

SIGIOT

public static final int SIGIOT
IOT instruction.

SIGABRT

public static final int SIGABRT
Used by abort, replace SIGIOT in the future.

SIGEMT

public static final int SIGEMT
EMT instruction.

SIGFPE

public static final int SIGFPE
Floating point exception.

SIGKILL

public static final int SIGKILL
Kill (cannot be caught or ignored).

SIGBUS

public static final int SIGBUS
Bus error.

SIGSEGV

public static final int SIGSEGV
Segmentation violation.

SIGSYS

public static final int SIGSYS
Bad argument to system call.

SIGPIPE

public static final int SIGPIPE
Write on a pipe with no one to read it.

SIGALRM

public static final int SIGALRM
Alarm clock.

SIGTERM

public static final int SIGTERM
Software termination signal from kill.

SIGUSR1

public static final int SIGUSR1
User defined signal = 1.

SIGUSR2

public static final int SIGUSR2
User defined signal = 2.

SIGCLD

public static final int SIGCLD
Child status change.

SIGCHLD

public static final int SIGCHLD
Child status change alias (POSIX).

SIGPWR

public static final int SIGPWR
Power-fail restart.

SIGWINCH

public static final int SIGWINCH
Window size change.

SIGURG

public static final int SIGURG
Urgent socket condition.

SIGPOLL

public static final int SIGPOLL
Pollable event occurred.

SIGIO

public static final int SIGIO
Socket I/O possible (SIGPOLL alias).

SIGSTOP

public static final int SIGSTOP
Stop (cannot be caught or ignored).

SIGTSTP

public static final int SIGTSTP
User stop requested from tty.

SIGCONT

public static final int SIGCONT
Stopped process has been continued.

SIGTTIN

public static final int SIGTTIN
Background tty read attempted.

SIGTTOU

public static final int SIGTTOU
Background tty write attempted.

SIGVTALRM

public static final int SIGVTALRM
Virtual timer expired.

SIGPROF

public static final int SIGPROF
Profiling timer expired.

SIGXCPU

public static final int SIGXCPU
Exceeded cpu limit.

SIGXFSZ

public static final int SIGXFSZ
Exceeded file size limit.

SIGWAITING

public static final int SIGWAITING
Process's lwps are blocked.

SIGLWP

public static final int SIGLWP
Special signal used by thread library.

SIGFREEZE

public static final int SIGFREEZE
Special signal used by CPR.

SIGTHAW

public static final int SIGTHAW
Special signal used by CPR.

SIGCANCEL

public static final int SIGCANCEL
Thread cancellation signal used by libthread.

SIGLOST

public static final int SIGLOST
Resource lost (e.g., record-lock lost).
Constructor Detail

POSIXSignalHandler

public POSIXSignalHandler()
Method Detail

addHandler

public static void addHandler(int signal,
                              AsyncEventHandler handler)
Add the given AsyncEventHandler to the list of handlers of the AsyncEvent of the given signal.
Parameters:
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.

removeHandler

public static void removeHandler(int signal,
                                 AsyncEventHandler handler)
Remove the given AsyncEventHandler to the list of handlers of the AsyncEvent of the given signal.
Parameters:
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.

setHandler

public static void setHandler(int signal,
                              AsyncEventHandler handler)
Set the given AsyncEventHandler as the handler of the AsyncEvent of the given signal.
Parameters:
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).