I want to be able to catch any signal(like SIGUSR1, SIGUSR2) in my spring boot application and trigger a some logic. The closest I could find was sun.misc.Signal but looks like it's deprecated since java 1.8 since I am getting this error for java 11 - [ERROR] package sun.misc does not exist. So, I am looking for an alternative to this that I can use in java 11.
Can someone please suggest some alternative?
I am running a spring boot application in Tomcat. Spring boot version - 2.6 , java version 11, Tomcat version 9.0.65