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

Jeroen Daanen commented on FELIX-5453:
--------------------------------------

Thank you very much Pierre for the extensive answer, it confirms my thoughts. 
In our product ServiceRequiringX is an Index and both aspects add functionality 
that changes what is index, so a re-index must take place if one of them is 
removed. In the example ServiceRequiringX must detect itself that the aspect1 
is removed, therefore the solution for me would be to use the ServiceTracker.
I think this issue can be closed now with resolution 'Not a bug'.

> Swap callback not called when there are multiple aspects on a service and one 
> of the aspects with lower rank is removed
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-5453
>                 URL: https://issues.apache.org/jira/browse/FELIX-5453
>             Project: Felix
>          Issue Type: Bug
>          Components: Dependency Manager
>    Affects Versions: org.apache.felix.dependencymanager-r8
>            Reporter: Jeroen Daanen
>         Attachments: Activator.java, Activator2.java
>
>
> If you have multiple aspects on a service with interface X and one of the 
> aspects with a lower rank is removed, the service requiring service X does 
> not get the swap callback.
> See the attached Activator with example code.
> The swap method is not called when 'aspect1' is removed.
> Actual output of running the activator:
> {noformat}
> Add: XImpl
> Swap old: XImpl
> Swap new: Aspect1
> Swap old: Aspect1
> Swap new: Aspect2
> Swap old: Aspect2
> Swap new: XImpl
> {noformat}
> I can understand why swap is not called, because for ServiceRequiringX 
> Aspect1 does not get really 'swapped' (the service stays Aspect2) But is 
> there any way to find out this is happening?



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

Reply via email to