felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Meschberger (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (FELIX-3963) Properly handle method resolution through reflection
Date Mon, 11 Mar 2013 08:31:12 GMT

     [ https://issues.apache.org/jira/browse/FELIX-3963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Felix Meschberger updated FELIX-3963:
-------------------------------------

    Description: 
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.

See also the discussion at http://felix.markmail.org/thread/rtkogb7uukyt6gky

  was:
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.

    
> 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.
> See also the discussion at http://felix.markmail.org/thread/rtkogb7uukyt6gky

--
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

Mime
View raw message