[ https://issues.apache.org/jira/browse/FELIX-356?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Felix Meschberger resolved FELIX-356. ------------------------------------- Resolution: Fixed The DependencyManager.bind(Object) method now tracks success with a separate flag: If the dependency is optional, the flag is initially set to true, as we don't care whether there are any services bound or not. If the dependency is mandatory, the flag is initially set to false and only set to true after the first service binding (ignoring the success of actually calling the component's bind method). Additionally, if the reference is singular the binding loop is aborted after the first service has been bound (again ignoring the success of actually calling the component's bind method). Fixed in Rev. 573179. Closing after deploying new snapshot. > DependencyManager.bind may bind to null and does not correctly check for > success > -------------------------------------------------------------------------------- > > Key: FELIX-356 > URL: https://issues.apache.org/jira/browse/FELIX-356 > Project: Felix > Issue Type: Bug > Components: Declarative Services > Reporter: Felix Meschberger > Assignee: Felix Meschberger > > In an active environment a service to be bound may disappear between the > access to the service reference and the acquiry of the service itself. As a > consequence the DependencyManager.bind(Object) method may call the > component's bind method with a null instance, which is not expected. > The DependencyManager.bind method should check whether the service still > exists before calling the component's bind method. > As a consequence the checks whether at least one service could be bound for > mandatory references and that at most one service is bound for singular > references have to be rethought: Currently binding fails if the first service > reference cannot be bound for singular references. In such situations the > binding also fails if calling the bind method fails. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.