You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Joao Assuncao (JIRA)" <ji...@apache.org> on 2008/11/21 16:22:44 UTC

[jira] Created: (FELIX-832) Bind method not invoked when the unbind method is unspecified after reference is changed

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.


[jira] Resolved: (FELIX-832) Bind method not invoked when the unbind method is unspecified after reference is changed

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved FELIX-832.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: scr-1.0.8

Moved the call to the ungetService method in Rev. 741593, so that service unbinding does not depend on the presence of an unbind method anymore.

Actually, this problem might also be present if services are not bound by a bind method but are accessed by locateService. In this case the service must also be ungotten in case of its unregistration

I have deployed SNAPSHOT version 1.0.7-20090206.153010-1 containing this fix.

Could you please verify its working in your use case and close the bug then ? Thanks.

> 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
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: scr-1.0.8
>
>
> 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.


[jira] Commented: (FELIX-832) Bind method not invoked when the unbind method is unspecified after reference is changed

Posted by "Joao Assuncao (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Closed: (FELIX-832) Bind method not invoked when the unbind method is unspecified after reference is changed

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler closed FELIX-832.
----------------------------------


> 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
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: scr-1.0.8
>
>
> 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.


[jira] Assigned: (FELIX-832) Bind method not invoked when the unbind method is unspecified after reference is changed

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger reassigned FELIX-832:
---------------------------------------

    Assignee: Felix Meschberger

> 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
>            Assignee: Felix Meschberger
>            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.


[jira] Commented: (FELIX-832) Bind method not invoked when the unbind method is unspecified after reference is changed

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12671156#action_12671156 ] 

Felix Meschberger commented on FELIX-832:
-----------------------------------------

Thanks for reporting this issue. It is in fact two-fold: The service must not only be "ungotten" if the reference goes away, but also if the component itself is being cleanup (though in the second case there is a general cleanup at then end of the disposal)

> 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
>            Assignee: Felix Meschberger
>            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.


[jira] Work started: (FELIX-832) Bind method not invoked when the unbind method is unspecified after reference is changed

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on FELIX-832 started by Felix Meschberger.

> 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
>            Assignee: Felix Meschberger
>            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.