felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Meschberger <fmesc...@adobe.com>
Subject Re: [InventoryPrinter] Finding methods by reflection
Date Mon, 11 Mar 2013 07:35:12 GMT

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 section 112.9.4
(Locating Component Methods) of the Declarative Services specification.
> 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.

Just using getDeclaredMethod is not fully correct, because you probably don't want to use
a private method from a super class or a package private method 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 methods 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 InventoryPrinter 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 ConfigurationPrinter methods.


>> --
>> Felix Meschberger | Principal Scientist | Adobe
> -- 
> Carsten Ziegeler
> cziegeler@apache.org

Felix Meschberger | Principal Scientist | Adobe

View raw message