From kato-spec-return-331-apmail-incubator-kato-spec-archive=incubator.apache.org@incubator.apache.org Mon Jan 11 11:46:54 2010 Return-Path: Delivered-To: apmail-incubator-kato-spec-archive@minotaur.apache.org Received: (qmail 56321 invoked from network); 11 Jan 2010 11:46:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Jan 2010 11:46:54 -0000 Received: (qmail 96757 invoked by uid 500); 11 Jan 2010 11:46:54 -0000 Delivered-To: apmail-incubator-kato-spec-archive@incubator.apache.org Received: (qmail 96729 invoked by uid 500); 11 Jan 2010 11:46:54 -0000 Mailing-List: contact kato-spec-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: kato-spec@incubator.apache.org Delivered-To: mailing list kato-spec@incubator.apache.org Received: (qmail 96719 invoked by uid 99); 11 Jan 2010 11:46:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jan 2010 11:46:54 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of david.griffiths@gmail.com designates 74.125.78.144 as permitted sender) Received: from [74.125.78.144] (HELO ey-out-1920.google.com) (74.125.78.144) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jan 2010 11:46:47 +0000 Received: by ey-out-1920.google.com with SMTP id 3so4914031eyh.8 for ; Mon, 11 Jan 2010 03:46:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=D3+aeAM9jS56jskzlE+l8m2mV6Wmb2tLo9KERwncxeA=; b=Xt4w1Im2H03RY+QxGvN6kWnmtVxkBu2Qh3HHu4V+T8ESLZ5tow+FUJxsyXQxNvEhSt SjxYYHAV4EJhKlkOZ3naOW6tIhqfz8RpN+Hu/BmLM2ELDD+lgpiJ3/vTy/xytCWKkPuO S99Iw0WyZ6d6o5QpVde2mitAx6F0MpoWKKGdw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=H9agfkaeBu/9Lvkts1k/+8UT+LDQv6xCAqc2m2PvI/vbBhN/o2AX0tpOae+Syg4lp8 j7E23SlOrBDp4aRpUew5nIi45VCIRWWi4/HpPPS/Xo4ffORbVNHJ3p1rnJC1G6ELOOV4 /UW1ygvav8qVlFhPhgaFEdg4b8YAs60irBDpE= MIME-Version: 1.0 Received: by 10.213.97.26 with SMTP id j26mr3290555ebn.46.1263210386472; Mon, 11 Jan 2010 03:46:26 -0800 (PST) In-Reply-To: References: Date: Mon, 11 Jan 2010 11:46:26 +0000 Message-ID: <892f710b1001110346m2eac6955y461c902d15d1d562@mail.gmail.com> Subject: Re: Replacing ImagePointer references in the Java Runtime API - first pass From: David Griffiths To: kato-spec@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Some people take the view that you shouldn't store type info in an object and that you should instead have a separate subinterface for each type. I'm not one of those people but just thought I'd mention it :) Cheers, Dave On Mon, Jan 11, 2010 at 10:20 AM, Steve Poole wr= ote: > The Handle interface below is at the core of my proposal for a replacemen= t > for places where ImagePointer is used in the JavaRuntime API. =A0 =A0Thou= gh it's > not all of it - =A0the JavaRuntime interface is also updated: > > The getObjectByAddress(long) method is replaced with a > getObjectByHandle(handle) method. > > A new =A0Handle createHandle(EntityType type,long reference) method has b= een > added to allow for the creation of these handles from external form data. > EntityType is an enum of Java Runtime API types =A0(currently only javaob= ject, > javaclass, monitor) > > These changes are in the codebase and seem to work ok. =A0We do need to > resolve the getAddress() method on JavaLocation to determine what it's fo= rm > should be. > > Also - what else could we call this other than Handle? =A0(I don't really= want > to use the pointer word but handle seems so old fashioned :-)) > > --- > javax.tools.diagnostics.runtime.java.Handle : > > /** > =A0* Describes a smart pointer that can be used to extract > =A0* a reference to an entity within a JavaRuntime instance > =A0* and can be presented to the same JavaRuntime instance to > =A0* reconstitute a semantically equivilent version of the original > =A0* entity. > =A0* > =A0* The handle is expected to be used to facilitate round tripping > =A0* where identity information about the entity needs to recorded outsid= e of > a > =A0* the analysing program (perhaps in a database) and then, at some late= r > =A0* stage , the original object needs to be recovered. > =A0* > =A0* > =A0*/ > public interface Handle { > > =A0 =A0/** > =A0 =A0 * Returns an implementation specific reference number that > =A0 =A0 * can be used (in conjunction with a type specification) to > =A0 =A0 * recreate the relevant API entity from a dump. > =A0 =A0 * > =A0 =A0 * @return reference number > =A0 =A0 */ > =A0 =A0public long getAddress(); > > =A0 =A0/** > =A0 =A0 * Returns an enumeration that indicates the type of object that > =A0 =A0 * this handle refers to. Never returns null. > =A0 =A0 * > =A0 =A0 */ > =A0 =A0public EntityType getType(); > > } > > > -- > Steve >