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 system supports POSIX signals.


Field Summary
private static int MAX_SIG
           
static int SIGABRT
          Used by abort, replace SIBIOT 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 alis (POSIX).
static int SIGCLD
          Child status change.
static int SIGCONT
          Stopped process has been continued.
static int SIGEMT
          EMT instructions.
static int SIGFPE
          Floaating 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
          Socked 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.
private static javax.realtime.AsyncEvent[] signalsHandlersList
           
static int SIGPIPE
          Write on a pipe with no one to read it.
static int SIGPOLL
          Pollable event occured.
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, javax.realtime.AsyncEventHandler handler)
          Add the given AsyncEventHandler to the list of handlers of the AsyncEvent of the given signal.
static void removeHandler(int signal, javax.realtime.AsyncEventHandler handler)
          Remove the given AsyncEventHandler to the list of handlers of the AsyncEvent of the given signal.
static void setHandler(int signal, javax.realtime.AsyncEventHandler handler)
          Set the given AsyncEventHandler as the handler of the AsyncEvent of the given signal.
private  void setSignals()
          Assigns machine-dependent values to all SIGxxxx constants.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIGABRT

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


SIGALRM

public static int SIGALRM
Alarm clock.


SIGBUS

public static int SIGBUS
Bus error.


SIGCANCEL

public static int SIGCANCEL
Thread cancellation signal used by libthread.


SIGCHLD

public static int SIGCHLD
Child status change alis (POSIX).


SIGCLD

public static int SIGCLD
Child status change.


SIGCONT

public static int SIGCONT
Stopped process has been continued.


SIGEMT

public static int SIGEMT
EMT instructions.


SIGFPE

public static int SIGFPE
Floaating point exception.


SIGFREEZE

public static int SIGFREEZE
Special signal used by CPR.


SIGHUP

public static int SIGHUP
Hangup.


SIGILL

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


SIGINT

public static int SIGINT
Interrupt (rubout).


SIGIO

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


SIGIOT

public static int SIGIOT
IOT instruction.


SIGKILL

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


SIGLOST

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


SIGLWP

public static int SIGLWP
Special signal used by thread library.


SIGPIPE

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


SIGPOLL

public static int SIGPOLL
Pollable event occured.


SIGPROF

public static int SIGPROF
Profiling timer expired.


SIGPWR

public static int SIGPWR
Power-fail restart.


SIGQUIT

public static int SIGQUIT
Quit (ASCII FS).


SIGSEGV

public static int SIGSEGV
Segmentation violation.


SIGSTOP

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


SIGSYS

public static int SIGSYS
Bad argument to system call.


SIGTERM

public static int SIGTERM
Software termination signal from kill.


SIGTHAW

public static int SIGTHAW
Special signal used by CPR.


SIGTRAP

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


SIGTSTP

public static int SIGTSTP
User stop requested from tty.


SIGTTIN

public static int SIGTTIN
Background tty read attempted.


SIGTTOU

public static int SIGTTOU
Background tty write attempted.


SIGURG

public static int SIGURG
Urgent socket condition.


SIGUSR1

public static int SIGUSR1
User defined signal = 1.


SIGUSR2

public static int SIGUSR2
User defined signal = 2.


SIGVTALRM

public static int SIGVTALRM
Virtual timer expired.


SIGWAITING

public static int SIGWAITING
Process's lwps are blocked.


SIGWINCH

public static int SIGWINCH
Window size change.


SIGXCPU

public static int SIGXCPU
Exceeded cpu limit.


SIGXFSZ

public static int SIGXFSZ
Exceeded file size limit.


MAX_SIG

private static final int MAX_SIG
See Also:
Constant Field Values

signalsHandlersList

private static javax.realtime.AsyncEvent[] signalsHandlersList
Constructor Detail

POSIXSignalHandler

public POSIXSignalHandler()
Method Detail

addHandler

public static void addHandler(int signal,
                              javax.realtime.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 a java.lang.IllegalArgumentException will be thrown.
handler - An AsyncEventHandler which will be scheduled when the given signal occurs.

removeHandler

public static void removeHandler(int signal,
                                 javax.realtime.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 a java.lang.IllegalArgumentException will be thrown.
handler - An AsyncEventHandler which will be scheduled when the given signal occurs.

setHandler

public static void setHandler(int signal,
                              javax.realtime.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 a java.lang.IllegalArgumentException will be thrown.
handler - An AsyncEventHandler which will be scheduled when the given signal occurs. If handler is null then no handler will be associated with this (i.e., remove all handlers).

setSignals

private void setSignals()
Assigns machine-dependent values to all SIGxxxx constants.