Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
try {
socket.close();
} catch (IOException e) {
e.printStackTrace();
}
}
});
On Feb 28, 9:50 am, "Isaac4given" <i...@users.sourceforge.net> wrote:
> Here's an important consideration:
> With open files for configurations and logs, and with some kind of
> network connection through Aspirin for sending email, how can we do
> whatever kind of cleanup we need when the systems running witl
> shutdown?
> 1. Is there any good way witl can detect and intercept an Operating
> System shutdown from Java?
> 2. When witl does detect the OS shutting down, how can witl stall the
> process until it finished cleaning up?