You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Pierre De Rop (JIRA)" <ji...@apache.org> on 2016/11/26 17:34:58 UTC

[jira] [Created] (FELIX-5429) Aspect swap callback sometimes not called on optional dependencies

Pierre De Rop created FELIX-5429:
------------------------------------

             Summary: Aspect swap callback sometimes not called on optional dependencies
                 Key: FELIX-5429
                 URL: https://issues.apache.org/jira/browse/FELIX-5429
             Project: Felix
          Issue Type: Bug
          Components: Dependency Manager
    Affects Versions: org.apache.felix.dependencymanager-r1
            Reporter: Pierre De Rop
            Assignee: Pierre De Rop
            Priority: Minor
             Fix For: org.apache.felix.dependencymanager-r9


This issue concerns the following corner case scenario:

You have a component A with a required dependency on "Required" service, and an optional dependency on a "B" service.

You have also an aspect for the "B" service.

So, when A starts, it will be called in 

- A.add(Required)
- A.add(originalBService)
- A.swap(originalBService, aspectForBService) // assuming the aspect is started after B service and after A

Now, there is a a ComponentStateListener on A which removes the B aspect when the "A" component is stopping.

So, the bug is the following: when you remove the "Required" Service, A is called in :

- A.remove(originalBService)
- A.stop()

so, here the A component should have been called like this 

- A.swap(aspectForBService, originalBService)
- A.remove(originalB)
- A.stop()

Here, the swap callback should be called because the state listening is removing the aspect while A is stopping.




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