Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 63271D035 for ; Mon, 11 Mar 2013 13:26:51 +0000 (UTC) Received: (qmail 10217 invoked by uid 500); 11 Mar 2013 13:26:51 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 10077 invoked by uid 500); 11 Mar 2013 13:26:50 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 9952 invoked by uid 99); 11 Mar 2013 13:26:46 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Mar 2013 13:26:46 +0000 Received: from localhost (HELO mail-oa0-f51.google.com) (127.0.0.1) (smtp-auth username cziegeler, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Mar 2013 13:26:45 +0000 Received: by mail-oa0-f51.google.com with SMTP id h2so4482448oag.10 for ; Mon, 11 Mar 2013 06:26:44 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.74.5 with SMTP id p5mr8494388obv.74.1363008404926; Mon, 11 Mar 2013 06:26:44 -0700 (PDT) Received: by 10.60.142.39 with HTTP; Mon, 11 Mar 2013 06:26:44 -0700 (PDT) In-Reply-To: References: <40B5B1C3-170D-48C5-B245-85FE3B8B592A@adobe.com> Date: Mon, 11 Mar 2013 14:26:44 +0100 Message-ID: Subject: Re: [InventoryPrinter] Finding methods by reflection From: Carsten Ziegeler To: dev@felix.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 2013/3/11 Felix Meschberger : > Hi, > > Am 10.03.2013 um 19:59 schrieb Carsten Ziegeler: > >> Hi, >> >>> My opinion would be: >>> >>> (a) search the implementation class only >>> (b) accept all method modifiers >>> (c) document to prefer private >>> >>> Alternatively we could search the class hierarchy as is defined in sect= ion 112.9.4 (Locating Component Methods) of the Declarative Services specif= ication. >> >> I think the current implementation searches the hierarchy > > Yes and no ;-) The current implementation walks the hierarchy but it uses= the Class.getMethod method to find the method, which actually only returns= public methods. So walking the hierarchy is essentially useless. > Ah, right - yes the idea was that the method has to be public, otherwise the service is not used, now I remember :) Carsten > Just using getDeclaredMethod is not fully correct, because you probably d= on't want to use a private method from a super class or a package private m= ethod from a super class in a different package. Which is why I also refer = to the DS specification, which explains how to actually find and select met= hods from superclasses. > > >> - I don't >> have a strong preference, but I think searching the hierarchy is >> better. > > I somehow have the impression that subclassing is not a concern for Inven= toryPrinter services and in fact may not even make sense. Which is probably= also why Web Console 4 does not walk the class hierarchy for finding Confi= gurationPrinter methods. > > Regards > Felix > >>> >>> -- >>> Felix Meschberger | Principal Scientist | Adobe >>> >>> >>> >>> >>> >>> >>> >> >> >> >> -- >> Carsten Ziegeler >> cziegeler@apache.org > > > -- > Felix Meschberger | Principal Scientist | Adobe > > > > > > > --=20 Carsten Ziegeler cziegeler@apache.org