Created
October 25, 2016 18:41
-
-
Save tomasfrancisco/2c0ea688ac5e0835f117a60f0753299b to your computer and use it in GitHub Desktop.
Terminate a program running a thread before.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Runtime.getRuntime().addShutdownHook(new Thread() { | |
@Override | |
public void run() { | |
try { | |
rt.stopReceiverTopic(); | |
rq.stopReceiverQueue(); | |
} catch (JMSException e) { | |
e.printStackTrace(); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment