[ 
https://issues.apache.org/jira/browse/FELIX-4907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14564333#comment-14564333
 ] 

Pierre De Rop commented on FELIX-4907:
--------------------------------------

I did more checks and compared the old bahavior that was used by DM3 when a 
configuration is lost:

in DM3, when a component defines a ConfigurationDependency:

1) when the configuration is lost; component.updated(null) is called, and then 
the component.stop() is called (the component is stopped).
2) when the component is removed (with "dm.remove(c)"), the component.stop() is 
just called, and component.updated(null) is not called.

but in DM4:

1) when the configuration is lost, component.stop() is first called, then 
component.updated(null) is called.

2) when the component is removed (with "dm.remove(c)"), the component.stop() is 
first called, then component.updated(null) is called.

So, in DM4, we should following the same behavior as in DM3: when the component 
is stopped, we should not call updated(null).

Now, I'm hesitant about the following other issues:

- when the configuration is lost, should we really invoke updated(null) ? After 
all, the component will be called in its component.stop() callback, so do we 
really need to invoke updated(null) ? Thanks for confirming ?

- When the configuration is lost (deleted), in DM3 we called 
component.updated(null) in the current ConfigurationAdmin thread, then we 
called component.stop(). But in DM4, we first stop the component (we call 
component.stop(); possibly in another thread than the ConfigurationAdmin 
thread), and then we call component.updated(null). 
So, should we reverse the order, like in DM3: first invoke 
component.updated(null), then invoke component.stop() ?


> ConfigurationDependency calls updated(null) when component is stopped.
> ----------------------------------------------------------------------
>
>                 Key: FELIX-4907
>                 URL: https://issues.apache.org/jira/browse/FELIX-4907
>             Project: Felix
>          Issue Type: Bug
>          Components: Dependency Manager
>    Affects Versions: org.apache.felix.dependencymanager-r3
>            Reporter: Pierre De Rop
>            Assignee: Pierre De Rop
>
> When a component has a Configuration Dependency, the updated callback is 
> invoked with a null Dictionary when the omponent is stopped.



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

Reply via email to