Java perform final action upon program termination?
<p>I'm prototyping a concurrent/distributed system in Java.  When a process is terminated (e.g. ctrl+c on command line or red button in Eclipse) I would like to broadcast a message to the other processes (one final method) before it goes away.  Tried doing it with finalize() but to no avail.  Just pure java with threads, sockets, and a main loop.  Thanks.</p>
