public abstract class SignalInterceptor
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
SignalInterceptor() |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
handle(java.lang.String signame)
Handle the given signal (which you had previously registered for).
|
protected void |
register(java.lang.String signame)
Register for the given signal.
|
protected boolean |
registerQuietly(java.lang.String signame)
A wrapper around
register(String) which never throws an
exception. |
protected void register(java.lang.String signame) throws com.googlecode.jmxtrans.util.SignalInterceptor.SignalInterceptorException
Register for the given signal. Note that the signal name should
not begin with SIG. For example, if you are interested in
SIGTERM, you should call register("TERM")
.
If the registration fails for any reason, a
SignalInterceptorException
will be thrown. This is usually
caused by one of the following conditions:
sun.misc.Signal*
classes are not available (e.g. you
are not using Sun's JVM).signame
is not a valid trappable signal name on this OS
(e.g. KILL can't be trapped, HUP does not exist on Windows)
signame
because it is
already being used for some other important purpose (e.g. QUIT
and/or BREAK cause the JVM to print diagnostic output).com.googlecode.jmxtrans.util.SignalInterceptor.SignalInterceptorException
protected boolean registerQuietly(java.lang.String signame)
register(String)
which never throws an
exception. Instead, it returns true
if registration
succeeded, and false
if it failed.protected abstract boolean handle(java.lang.String signame)
Copyright © 2012 Jon Stevens and a gang of pencils. All Rights Reserved. Build version: 20121016-151320-36564abc7e