Re: how to shutdown

4 views
Skip to first unread message

Isaac4given

unread,
Aug 30, 2007, 2:12:04 PM8/30/07
to WITL (Walk In The Light)
After we initialize "socket", we could do this:

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?

Isaac4given

unread,
Aug 30, 2007, 2:15:26 PM8/30/07
to WITL (Walk In The Light)
Reply all
Reply to author
Forward
0 new messages