Quantcast
Channel: Capture SIGINT in Java - Stack Overflow
Browsing all 4 articles
Browse latest View live

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 Article



Answer 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 Article

Answer 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 Article

Capture 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
Browsing all 4 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>