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

Pierre De Rop closed FELIX-4879.
--------------------------------
    Resolution: Fixed

Canceling this issue, which is invalid.

Indeed, when using a ConfigurationDependency callback instance is different 
than the component instance on which the dependency is added, then the 
ConfigurationDependency must not be considered as a "needsInstance" dependency. 
For example, typically, when setting the dependency callback instance on a 
factory, then we must not instantiate the component, because the configuration 
has to be applied first on the factory, which will then decide which component 
has to be instantiated from its "create" callback.

See an example there in [1].

[1] 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/compositefactory/

> ConfigurationDependency should always "need instance".
> ------------------------------------------------------
>
>                 Key: FELIX-4879
>                 URL: https://issues.apache.org/jira/browse/FELIX-4879
>             Project: Felix
>          Issue Type: Improvement
>          Components: Dependency Manager
>    Affects Versions: org.apache.felix.dependencymanager-r2
>            Reporter: Pierre De Rop
>            Assignee: Pierre De Rop
>            Priority: Minor
>             Fix For: org.apache.felix.dependencymanager-r3
>
>
> Currently, the ConfigurationDependency only specifies that it "needs an 
> instance" if there is no callback instance. But if there is a callback 
> instance, then the "needsInstance" method returns false (because we have the 
> callback instance already).
> So, from one side, it makes sense to not require a component instance if 
> there is a callback instance configured (since we have the callback instance, 
> we don't need the component instance).
> However, the callback instance is then not able to get access to the 
> component instances while being invoked (the first time), using the Component 
> object.
> So, the ConfigurationDependency should always have a "needsInstance" method 
> returning true (always), even if there is a callback instance configured for 
> the Configuration Dependency.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to