Skip to content

Instantly share code, notes, and snippets.

@treaz
Created April 23, 2015 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save treaz/19c8fb4a90e1cb4b9448 to your computer and use it in GitHub Desktop.
Save treaz/19c8fb4a90e1cb4b9448 to your computer and use it in GitHub Desktop.
package com.aimms.testwrapper;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Horia
*/
public class ShutdownHookTest {
public static void main(String[] args) {
Runtime.getRuntime().addShutdownHook(new Thread()
{
@Override
public void run()
{
System.out.println("Shutdown hook ran!");
}
});
while (true)
{
System.out.println("hello");
try {
Thread.sleep(5000);
} catch (InterruptedException ex) {
System.out.println(ex);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment