DependencyManager does not correctly handle service counting
------------------------------------------------------------

                 Key: FELIX-425
                 URL: https://issues.apache.org/jira/browse/FELIX-425
             Project: Felix
          Issue Type: Bug
          Components: Declarative Services
            Reporter: Felix Meschberger
            Assignee: Felix Meschberger


Whenever a referenced service is added to or removed from the framework, the 
DependencyManager.serviceAdded or serviceRemoved method is called respectively. 
These methods maintain a counter of services registered in the system matching 
the selection criteria (service interface and target filter) :

   - when a service added whose ServiceReference does not match the target 
filter (if any) is ignored. Otherwise the internal
       counter is incremented regardless of whether the service will actually 
be bound or not
   - when a service is removed it is ignored, if it is not bound. The internal 
counter is only decremented if the service is bound.

The problem is, that upon service removal the counter should be decremented if 
the service matches the target filter regardless of whether the service bound 
or not. Otherwise the counter might not be decremented and the dependency may 
be marked satisfied even though no (or not enough) service(s) are available.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to