Bind method selection must not expect the component's bundle to import the
service interface type
-------------------------------------------------------------------------------------------------
Key: FELIX-2520
URL: https://issues.apache.org/jira/browse/FELIX-2520
Project: Felix
Issue Type: Bug
Components: Declarative Services (SCR), Specification compliance
Affects Versions: scr-1.4.0
Reporter: Felix Meschberger
Assignee: Felix Meschberger
Fix For: scr-1.4.2
Our Declarative Services implementation tries to load the type of the bound
service through the class loader of the component. This has the side-effect of
expecting the component's bundle to actually import (and wire to) the package
providing the interface.
On the other hand the Declarative Services specification states, that a
bind/unbind method is acceptable if "the type of the argument is assignable
from the type specified by the reference's interface attribute" (OSGi
Compendium R4.2, Section 112.3.1, Accessing Services). This does not imply that
the component must know the service type but a supertype of the service type.
For example the CT contains a test where the component's bind method expects an
Object type parameter (which is certainly assignable from any type) but the
component's bundle does not import the actual interface type. Thus with the
current implementation the CT test fails.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.