// Register a shutdown thread Runtime.getRuntime().addShutdownHook(new Thread() { // This method is called during shutdown public void run() { // Do shutdown work ... } });
// Register a shutdown thread Runtime.getRuntime().addShutdownHook(new Thread() { // This method is called during shutdown public void run() { // Do shutdown work ... } });