You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2013/03/11 09:29:13 UTC

[jira] [Created] (FELIX-3963) Properly handle method resolution through reflection

Felix Meschberger created FELIX-3963:
----------------------------------------

             Summary: Properly handle method resolution through reflection
                 Key: FELIX-3963
                 URL: https://issues.apache.org/jira/browse/FELIX-3963
             Project: Felix
          Issue Type: Bug
          Components: Inventory
    Affects Versions: inventory-1.0.0
            Reporter: Felix Meschberger
            Assignee: Felix Meschberger
             Fix For: inventory-1.0.0


An InventoryPrinter can be registered as an InventoryPrinter service implementing the interface or it can be registered as service of any type as long as a particular method signature is implemented (along with a number of service registration properties required in both cases).

The method signature is similar to the InventoryPrinter method is:

   void print(String mode, PrinterWriter writer, boolean isZip)

Previously the ConfigurationPrinter support in Web Console 4.0 supported the same mechanism (with a slightly different signature, of course).

The question is, how is the method found:

(1) Use the service implementation class only to find any declared method. This is how Web Console 4.0 supports ConfigurationPrinter discovery.

(2) Use the service implementation class hierarchy to find a properly declared method. This is the current intent of the InventoryPrinter.

I think for the backwards compatibility use case (ConfigurationPrinter signatures) we should implement the "implementation-class-only" variant (1).

For new InventoryPrinter services we might consider variant (2). Yet I am not sure, whether this really is usefull: Does such a one-off InventoryPrinter service really support inheritance and method selection through the class hierarchy ? In such cases implementing the InventoryPrinter might make more sense.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira