Answer by delitescere for Capture SIGINT in Java
Since at least Java 6, the HotSpot java command has had a -Xrs flag to disable the JVM signal handlers.If you use it, you need to implement your own SIGINT, SIGTERM, SIGHUP, and SIGQUIT handlers,...
View ArticleAnswer by user177800 for Capture SIGINT in Java
The way to handle this would be to register a shutdown hook. If you use (SIGINT) kill -2 will cause the program to gracefully exit and run the shutdown hooks.Registers a new virtual-machine shutdown...
View ArticleAnswer by Asgeir S. Nilsen for Capture SIGINT in Java
Take a look at Integrating Signal and Exception Handling describing the HotSpot JVM's ability do do signal chaining. It does involve some C-level trickery though.Wouldn't...
View ArticleCapture SIGINT in Java
What is the best way to capture a kill signal in java without using JNI. I did discover the sun.misc.Signal and the sun.misc.SignalHandler and the warning of the possibility of being removed in the...
View Article
More Pages to Explore .....