|
Java™ by example!
|
|
|
How do I catch a specific SIGNAL?
You can use the undocumented class sun.misc.Signal. But beware of using the Sun packages. This program allows you to catch any of the following signals:
The example program (Linux/Solaris) demonstrates to catch and perform a System.exit only with a SIGTERM. A SIGHUP will not cause the program to exit. Main.java:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|