|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object posix.Signal
public class Signal
A posix signal. A posix signal represents an external event of some
sort. For instance, SIGINTR
means that a user interrupt signal
was raised by the tty driver - usually because the user pressed the INTR
key (typically ^C).
Some posix signals represent internal software errors. For
example SIGBUS
means that a load or store was attempted with
incorrect alignment. We do not handle these internal
events for Java - only the JVM could do something sensible with them.
Furthermore, some posix signals are probably used by the JVM itself. For
example, SIGCHLD
means that a process started via
Runtime.exec()
has terminated. For this reason, only
selected signals are exported via static constants.
Each Signal is in one of three states. SIG_DFL
means that
the default action is taken when the signal is received. This usually
means stopping the JVM process. Whether any cleanup takes place depends
on the JVM. SIG_IGN
means that the signal is ignored.
SIG_EVT
means that the signal is converted to a JDK1.1 style
Java event.
Field Summary | |
---|---|
static int |
SIG_DFL
|
static int |
SIG_EVT
|
static int |
SIG_IGN
|
static Signal |
SIGDANGER
Paging space is low, or power failure. |
static Signal |
SIGHUP
The terminal or X session has disconnected. |
static Signal |
SIGINT
The user has sent an interrupt. |
static Signal |
SIGQUIT
The user has sent a diagnostic abort. |
static Signal |
SIGTERM
The process is being terminated. |
static Signal |
SIGUSR1
Application dependent signal. |
static Signal |
SIGUSR2
Application dependent signal. |
static Signal |
SIGWINCH
The terminal window has changed size. |
Method Summary | |
---|---|
void |
addSignalListener(SignalListener l)
|
int |
getAction()
|
void |
kill(int pid)
Send this Signal to another process. |
static int |
kill(int pid,
int sig)
Send signal to process using posix call. |
void |
processSignal()
Send a SignalEvent to all listeners. |
void |
removeSignalListener(SignalListener l)
|
void |
setAction(int action)
Set the signal handling action type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Signal SIGHUP
public static final Signal SIGINT
public static final Signal SIGQUIT
public static final Signal SIGUSR1
public static final Signal SIGUSR2
public static final Signal SIGDANGER
public static final Signal SIGTERM
public static final Signal SIGWINCH
public static final int SIG_DFL
public static final int SIG_IGN
public static final int SIG_EVT
Method Detail |
---|
public void setAction(int action)
action
- one of SIG_DFL,SIG_IGN,SIG_EVT
IllegalStateException
- if the JVM already traps this signalpublic final int getAction()
public void addSignalListener(SignalListener l)
public void removeSignalListener(SignalListener l)
public void processSignal()
public static int kill(int pid, int sig)
pid
- process id to signalsig
- native signal index
public void kill(int pid) throws IPCException
pid
- the Posix process id
IPCException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |