The JVM spec lists a number of abnormal conditions that may occur like this. You might look in the JVM spec in section 5, "Loading, Linking, and Initializing", for detailed information about how a JVM is supposed to handle these conditions. Most of them should already be built in to every JVM, but if you need something special, doing it like the JVM is definitely the best way to proceed.
Dan Lydick > [Original Message] > From: Leo Li <[EMAIL PROTECTED]> > To: <harmony-dev@incubator.apache.org> > Date: 8/9/06 9:53:24 PM > Subject: [classlib][instrument]Method to terminate VM. > > Hi, all > During the implementaion of instrument, I encounter the choice about > how to terminate the VM when some abnormal event occurs, for example, the > expected jar file does not exist or the implementation class of > Instrumentation cannot be found. The most simple and direct way is just to > call exit(), and then the whole process will terminate. Hence OS will treat > with all the release of resources. However, I propose to use FatalError of > JNI instead, which notifies the VM to suicide, because it gives right to the > implementation of VM to take charge of its own funeral affairs, which might > include, for example, logging the cause of its crash. > Any suggestion from VM guys? > Thanks :) > > -- > Leo Li > China Software Development Lab, IBM --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]