Pure Danger Tech


sun.misc.Signal alternatives?

26 Sep 2014

There seems to be a push underway to wean Java developers off of the “internal” sun.* packages in Java 9+.

I was notified that Clojure currently uses sun.misc.Signal/SignalHandler in the Clojure REPL to intercept SIGINT (ctrl-c) to abort evaluation of the current expression (instead of terminating the process).

Is there a viable replacement to using this functionality for the purposes of intercepting SIGINT? (I know there are other alternatives with shutdown hooks for some other signal uses but this is different.) Is anyone working via official channels on an API for this?