Catching POSIX signals with Java code is possible, but at the price of depending on a particular vendor's implementation of the JVM. In this case we chose Java 1.5 from Sun Microsystems.
Signals give an external process the ability to notify (signal) another running process of certain events, such as imminent system shutdown, the desire to terminate the process if it has ceased to respond, respond to a disconnect and/or reload its configuration files, etc. This mechanism is especially prominent with daemons (on MS Windows that would be a "service", more or less) which have run disconnected from any other process, without a GUI, and need to be controlled by means other than a mouse.
Our documentation supplies you with the knowledge to let your Java software receive and react to signals, and there's even source code to get you started and adapt to your own projects.
Description: | Catching POSIX signals in Java is possible, albeit at the cost of a dependency on a particular vendor's libraries. Code within. |
Documentation: | Signals-in-Java.odt (103.2KiB) Signals-in-Java.pdf (211.5KiB) SignalTest.java (5.3KiB) |
All content is copyright © Ringlord Technologies unless otherwise stated. We do encourage deep linking to our site's pages but forbid direct reference to images, software or other non-page resources stored here; likewise, do not embed our content in frames or other constructs that may mislead the reader about the content ownership. Play nice, yes?