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

Joao Assuncao commented on FELIX-832:
-------------------------------------

This seems to occur because DependencyManager.ungetService(...) is invoked in 
DependencyManager.invokeUnbindMethod(...). In the situation where unbind is 
undefined, the reference isn't removed from the list of bound services, and 
because of that, serviceAdded(...) will find the service still bound and will 
not invoke the bind method.
The following change seems to fix this problem:
...
if ( m_dependencyMetadata.getUnbind() != null )
{
  invokeUnbindMethod( instance, reference );
}
+ungetService( reference );
...

> Bind method not invoked when the unbind method is unspecified after reference 
> is changed
> ----------------------------------------------------------------------------------------
>
>                 Key: FELIX-832
>                 URL: https://issues.apache.org/jira/browse/FELIX-832
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.0.6
>         Environment: Felix 1.2.1
>            Reporter: Joao Assuncao
>            Priority: Minor
>
> I have a declarative service with a dynamic reference with cardinality 0..1, 
> and since I'm not interested in the unbind notification I did not specified 
> the unbind method.
> I noticed that Felix (1.2.1) invokes the bind method the first time, but it 
> does not invoke it when the reference is changed. After I add a unbind method 
> it works as expected.

-- 
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