notifying the object before jvm terminates

hi,

i have to process some task before jvm terminates normally or abnormally.In jdk1.3.1 you can use addShutDownHook(Thread t) of jvm RunTime.But our application is using jdk1.2.1 which does not support this feature.Can u tell me how to come out of this problem.

thanks& rgdsgopal

[310 byte] By [k_gopalkrishna_gk] at [2007-9-26 19:52:29]
# 1

I don't think it is possible in 1.2.1. You can only make sure before you call System.exit() that you clean up your code and try to catch any exceptions that otherwise would terminate your code abnormally.

For example try to catch exceptions before your non-daemon threads exits abnormally and call a static method in a class (for example to register/deregister threads) so this class knows when it is time to clean up. And you might also do the same to be notified when the main method exits.

http://developer.java.sun.com/developer/TechTips/2000/tt0711.html#tip1

abnormal at 2007-7-3 13:09:00 > top of Java-index,Core,Core APIs...