I have some Java code running on server in infinite loop. Currently I am using "kill -9 process_id"
to stop process. But kill command forcefully stop Java process without cleaning resource.
I want to implement signal handler in Java just like C++ so that I can clean all resource and gracefully stop Java process.
Can anyone please suggest me the right way to do this?