public ShutdownHook() { // register a shutdown hook for this class. // a shutdown hook is an initialzed but not started thread, which will get up and run // when the JVM is about to exit. this is used for short clean up tasks. Runtime.getRuntime().addShutdownHook(new Thread(...