From below code am able to shutdown the process.
ShutdownHook s1 = new ShutdownHook();
s1.attachShutDownHook();
context.registerShutdownHook();
Logger.debug("Shutting down....");
But now I need to shutdown all threads grace fully. So for this how can I implement the code in this existing code or how can I improve it?
Kindly, let me know if there is a way for it.