Is there a way to add a shutdown hook that is only fired when the program is shut down because of a System shutdown.
I don't want the code to run when the code finishes regularly, only on other Exits.
With addShutDownHook the Thread runs no matter how the program terminated