ShutDown method

Is there a method to handle java program shutdowns? I know in applets I can use the stop() method.. How about normal java programs?
[138 byte] By [Conquerana] at [2007-10-3 8:29:52]
# 1
Hi,It depends on what you mean. You can terminate the application by calling System.exit(int)Kaj
kajbja at 2007-7-15 3:36:48 > top of Java-index,Java Essentials,New To Java...
# 2
no I mean, a way to cleanup resources and what not.. in my example I have a server, and when I shut it down, I want to send a message to all clients first :)
Conquerana at 2007-7-15 3:36:48 > top of Java-index,Java Essentials,New To Java...
# 3
You should in that case take a look at Runtime.shutDownHook Kaj
kajbja at 2007-7-15 3:36:48 > top of Java-index,Java Essentials,New To Java...