Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 31181 invoked from network); 14 Aug 2006 03:39:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Aug 2006 03:39:47 -0000 Received: (qmail 9217 invoked by uid 500); 14 Aug 2006 03:39:41 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 9172 invoked by uid 500); 14 Aug 2006 03:39:41 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 9161 invoked by uid 99); 14 Aug 2006 03:39:40 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Aug 2006 20:39:40 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of liyilei1979@gmail.com designates 64.233.182.185 as permitted sender) Received: from [64.233.182.185] (HELO nf-out-0910.google.com) (64.233.182.185) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Aug 2006 20:39:40 -0700 Received: by nf-out-0910.google.com with SMTP id a25so1616806nfc for ; Sun, 13 Aug 2006 20:39:18 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=NXznq/wn5c4mwbv9ryoZvnQY30ahRsoIt1TE/PIY/xOVhti4VIMWDVE7U4f7qAPpUbOG+QR95lP1PeEg/zFLprqs3Rhjx2Cou5ZsDYNKAA8wCZyVYqmSzVelWdcJoTVW8rRk1jubqv49gZ8g+fsCGYsKlSKgh7YOGGJE/lsSAac= Received: by 10.78.117.10 with SMTP id p10mr3078669huc; Sun, 13 Aug 2006 20:39:18 -0700 (PDT) Received: by 10.78.119.4 with HTTP; Sun, 13 Aug 2006 20:39:18 -0700 (PDT) Message-ID: Date: Mon, 14 Aug 2006 11:39:18 +0800 From: "Leo Li" To: harmony-dev@incubator.apache.org, geir@pobox.com Subject: Re: [classlib][instrument]Method to terminate VM. In-Reply-To: <44DC7E8E.8010404@pobox.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_170268_32228271.1155526758298" References: <44DBE924.7060900@gmail.com> <44DC7E8E.8010404@pobox.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_170268_32228271.1155526758298 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, all The case is we need to load an implementation class during VM init and should terminate it if the class cannot be found. Here is the code. inst_class = (*env)->FindClass(env, "org/apache/harmony/instrument/internal/InstrumentationImpl"); if(NULL == inst_class){ //VM exits abnormally. (*env)->FatalError(env,"class cannot find: org/apache/harmony/instrument/internal/InstrumentationImpl"); } Thank you. On 8/11/06, Geir Magnusson Jr wrote: > > How far along is this code? Any chance you want to toss up a snapshot > of it so people can look and comment and ... maybe even help? > > geir > > > Jimmy, Jing Lv wrote: > > Leo Li wrote: > >> 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 :) > >> > > > > Hi, > > > > I agree that use VM FatalError is better than system exit(). If no > > objections, I will make code that way. > > > > --------------------------------------------------------------------- > Terms of use : http://incubator.apache.org/harmony/mailing.html > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org > For additional commands, e-mail: harmony-dev-help@incubator.apache.org > > -- Leo Li China Software Development Lab, IBM ------=_Part_170268_32228271.1155526758298--