You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "I-Ann Chen (JIRA)" <ji...@apache.org> on 2007/09/14 22:42:32 UTC

[jira] Created: (FELIX-364) 0..1 dynamic service reference does not bind properly.

0..1 dynamic service reference does not bind properly.
------------------------------------------------------

                 Key: FELIX-364
                 URL: https://issues.apache.org/jira/browse/FELIX-364
             Project: Felix
          Issue Type: Bug
          Components: Declarative Services
    Affects Versions: 0.8.0
         Environment: Java 1.6
            Reporter: I-Ann Chen


There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
2. If the service is started after the component referencing it, then the service is never bound to the component.

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


[jira] Updated: (FELIX-364) 0..1 dynamic service reference does not bind properly.

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

I-Ann Chen updated FELIX-364:
-----------------------------

    Attachment:     (was: patch.txt)

> 0..1 dynamic service reference does not bind properly.
> ------------------------------------------------------
>
>                 Key: FELIX-364
>                 URL: https://issues.apache.org/jira/browse/FELIX-364
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>    Affects Versions: 0.8.0
>         Environment: Java 1.6
>            Reporter: I-Ann Chen
>         Attachments: patch.txt
>
>
> There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
> 1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
> 2. If the service is started after the component referencing it, then the service is never bound to the component.

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


[jira] Updated: (FELIX-364) 0..1 dynamic service reference does not bind properly.

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

I-Ann Chen updated FELIX-364:
-----------------------------

    Attachment: patch.txt

Proposed fix.

> 0..1 dynamic service reference does not bind properly.
> ------------------------------------------------------
>
>                 Key: FELIX-364
>                 URL: https://issues.apache.org/jira/browse/FELIX-364
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>    Affects Versions: 0.8.0
>         Environment: Java 1.6
>            Reporter: I-Ann Chen
>         Attachments: patch.txt
>
>
> There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
> 1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
> 2. If the service is started after the component referencing it, then the service is never bound to the component.

-- 
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-364) 0..1 dynamic service reference does not bind properly.

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

Work on FELIX-364 started by Felix Meschberger.

> 0..1 dynamic service reference does not bind properly.
> ------------------------------------------------------
>
>                 Key: FELIX-364
>                 URL: https://issues.apache.org/jira/browse/FELIX-364
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>    Affects Versions: 0.8.0
>         Environment: Java 1.6
>            Reporter: I-Ann Chen
>            Assignee: Felix Meschberger
>         Attachments: patch.txt
>
>
> There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
> 1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
> 2. If the service is started after the component referencing it, then the service is never bound to the component.

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


[jira] Commented: (FELIX-364) 0..1 dynamic service reference does not bind properly.

Posted by "I-Ann Chen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529423 ] 

I-Ann Chen commented on FELIX-364:
----------------------------------

This seems to fix my issues. Thanks much. Sorry for the delay in reply.

> 0..1 dynamic service reference does not bind properly.
> ------------------------------------------------------
>
>                 Key: FELIX-364
>                 URL: https://issues.apache.org/jira/browse/FELIX-364
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>    Affects Versions: 0.8.0
>         Environment: Java 1.6
>            Reporter: I-Ann Chen
>            Assignee: Felix Meschberger
>         Attachments: patch.txt
>
>
> There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
> 1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
> 2. If the service is started after the component referencing it, then the service is never bound to the component.

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


[jira] Commented: (FELIX-364) 0..1 dynamic service reference does not bind properly.

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

Felix Meschberger commented on FELIX-364:
-----------------------------------------

Thanks for reporting this issue. It turns out, that support for non-multiple (cardinality 0..1 or 1..1) dynamically bound services is not implemented properly at all. 

The DependencyManager class internally keeps all services being tracked. In the case of multiple service bindings, this is no issue as the bind and unbind methods must just be called. For non-multiple references, only one service must be bound and this is also the only service, which may be unbound.

The solution to this problem is, that the DependencyManager has to keep track of which service has actually been bound in the case of non-multiple bindings to decide whether to bind a new service and whether to unbind a service being unregistered.

> 0..1 dynamic service reference does not bind properly.
> ------------------------------------------------------
>
>                 Key: FELIX-364
>                 URL: https://issues.apache.org/jira/browse/FELIX-364
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>    Affects Versions: 0.8.0
>         Environment: Java 1.6
>            Reporter: I-Ann Chen
>            Assignee: Felix Meschberger
>         Attachments: patch.txt
>
>
> There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
> 1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
> 2. If the service is started after the component referencing it, then the service is never bound to the component.

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


[jira] Assigned: (FELIX-364) 0..1 dynamic service reference does not bind properly.

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

Felix Meschberger reassigned FELIX-364:
---------------------------------------

    Assignee: Felix Meschberger

> 0..1 dynamic service reference does not bind properly.
> ------------------------------------------------------
>
>                 Key: FELIX-364
>                 URL: https://issues.apache.org/jira/browse/FELIX-364
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>    Affects Versions: 0.8.0
>         Environment: Java 1.6
>            Reporter: I-Ann Chen
>            Assignee: Felix Meschberger
>         Attachments: patch.txt
>
>
> There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
> 1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
> 2. If the service is started after the component referencing it, then the service is never bound to the component.

-- 
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-364) 0..1 dynamic service reference does not bind properly.

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

Work on FELIX-364 started by Felix Meschberger.

> 0..1 dynamic service reference does not bind properly.
> ------------------------------------------------------
>
>                 Key: FELIX-364
>                 URL: https://issues.apache.org/jira/browse/FELIX-364
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>    Affects Versions: 0.8.0
>         Environment: Java 1.6
>            Reporter: I-Ann Chen
>            Assignee: Felix Meschberger
>         Attachments: patch.txt
>
>
> There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
> 1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
> 2. If the service is started after the component referencing it, then the service is never bound to the component.

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


[jira] Work stopped: (FELIX-364) 0..1 dynamic service reference does not bind properly.

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

Work on FELIX-364 stopped by Felix Meschberger.

> 0..1 dynamic service reference does not bind properly.
> ------------------------------------------------------
>
>                 Key: FELIX-364
>                 URL: https://issues.apache.org/jira/browse/FELIX-364
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>    Affects Versions: 0.8.0
>         Environment: Java 1.6
>            Reporter: I-Ann Chen
>            Assignee: Felix Meschberger
>         Attachments: patch.txt
>
>
> There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
> 1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
> 2. If the service is started after the component referencing it, then the service is never bound to the component.

-- 
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-364) 0..1 dynamic service reference does not bind properly.

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

Work on FELIX-364 started by Felix Meschberger.

> 0..1 dynamic service reference does not bind properly.
> ------------------------------------------------------
>
>                 Key: FELIX-364
>                 URL: https://issues.apache.org/jira/browse/FELIX-364
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>    Affects Versions: 0.8.0
>         Environment: Java 1.6
>            Reporter: I-Ann Chen
>            Assignee: Felix Meschberger
>         Attachments: patch.txt
>
>
> There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
> 1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
> 2. If the service is started after the component referencing it, then the service is never bound to the component.

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


[jira] Resolved: (FELIX-364) 0..1 dynamic service reference does not bind properly.

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

Felix Meschberger resolved FELIX-364.
-------------------------------------

    Resolution: Fixed

I have (once again) refactored the DependencyManager class:

> Only the services to which the dependency manager is actually bound is kept in an internal map
> The number of available services is set initially from the number of already available services and then
   updated as part of the ServiceListener.serviceChanged handling
> Access to the service instances is centralized and thus guarantees that service lookup and service binding
   allways use the same references and that bound services are ungot when the dependency manager is
   closed.

Could you please confirm, that this fix solves your issues. I will deploy a new snapshot after getting your confirmation. Thanks.

> 0..1 dynamic service reference does not bind properly.
> ------------------------------------------------------
>
>                 Key: FELIX-364
>                 URL: https://issues.apache.org/jira/browse/FELIX-364
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>    Affects Versions: 0.8.0
>         Environment: Java 1.6
>            Reporter: I-Ann Chen
>            Assignee: Felix Meschberger
>         Attachments: patch.txt
>
>
> There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
> 1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
> 2. If the service is started after the component referencing it, then the service is never bound to the component.

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


[jira] Updated: (FELIX-364) 0..1 dynamic service reference does not bind properly.

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

Felix Meschberger updated FELIX-364:
------------------------------------

    Fix Version/s: scr-1.0.0

> 0..1 dynamic service reference does not bind properly.
> ------------------------------------------------------
>
>                 Key: FELIX-364
>                 URL: https://issues.apache.org/jira/browse/FELIX-364
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: felix-0.8.0
>         Environment: Java 1.6
>            Reporter: I-Ann Chen
>            Assignee: Felix Meschberger
>             Fix For: scr-1.0.0
>
>         Attachments: patch.txt
>
>
> There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
> 1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
> 2. If the service is started after the component referencing it, then the service is never bound to the component.

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


[jira] Commented: (FELIX-364) 0..1 dynamic service reference does not bind properly.

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

Felix Meschberger commented on FELIX-364:
-----------------------------------------

Deployed new snapshot build containing this fix.

> 0..1 dynamic service reference does not bind properly.
> ------------------------------------------------------
>
>                 Key: FELIX-364
>                 URL: https://issues.apache.org/jira/browse/FELIX-364
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>    Affects Versions: 0.8.0
>         Environment: Java 1.6
>            Reporter: I-Ann Chen
>            Assignee: Felix Meschberger
>         Attachments: patch.txt
>
>
> There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
> 1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
> 2. If the service is started after the component referencing it, then the service is never bound to the component.

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


[jira] Closed: (FELIX-364) 0..1 dynamic service reference does not bind properly.

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

Felix Meschberger closed FELIX-364.
-----------------------------------


Thanks for the feedback. So I close this issue now.

> 0..1 dynamic service reference does not bind properly.
> ------------------------------------------------------
>
>                 Key: FELIX-364
>                 URL: https://issues.apache.org/jira/browse/FELIX-364
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>    Affects Versions: 0.8.0
>         Environment: Java 1.6
>            Reporter: I-Ann Chen
>            Assignee: Felix Meschberger
>         Attachments: patch.txt
>
>
> There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
> 1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
> 2. If the service is started after the component referencing it, then the service is never bound to the component.

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


[jira] Updated: (FELIX-364) 0..1 dynamic service reference does not bind properly.

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

I-Ann Chen updated FELIX-364:
-----------------------------

    Attachment: patch.txt

Here's a proposed fix for the issue.

> 0..1 dynamic service reference does not bind properly.
> ------------------------------------------------------
>
>                 Key: FELIX-364
>                 URL: https://issues.apache.org/jira/browse/FELIX-364
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>    Affects Versions: 0.8.0
>         Environment: Java 1.6
>            Reporter: I-Ann Chen
>         Attachments: patch.txt
>
>
> There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
> 1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
> 2. If the service is started after the component referencing it, then the service is never bound to the component.

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


[jira] Work stopped: (FELIX-364) 0..1 dynamic service reference does not bind properly.

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

Work on FELIX-364 stopped by Felix Meschberger.

> 0..1 dynamic service reference does not bind properly.
> ------------------------------------------------------
>
>                 Key: FELIX-364
>                 URL: https://issues.apache.org/jira/browse/FELIX-364
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>    Affects Versions: 0.8.0
>         Environment: Java 1.6
>            Reporter: I-Ann Chen
>            Assignee: Felix Meschberger
>         Attachments: patch.txt
>
>
> There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
> 1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
> 2. If the service is started after the component referencing it, then the service is never bound to the component.

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


[jira] Updated: (FELIX-364) 0..1 dynamic service reference does not bind properly.

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

I-Ann Chen updated FELIX-364:
-----------------------------

    Comment: was deleted

> 0..1 dynamic service reference does not bind properly.
> ------------------------------------------------------
>
>                 Key: FELIX-364
>                 URL: https://issues.apache.org/jira/browse/FELIX-364
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>    Affects Versions: 0.8.0
>         Environment: Java 1.6
>            Reporter: I-Ann Chen
>         Attachments: patch.txt
>
>
> There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
> 1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
> 2. If the service is started after the component referencing it, then the service is never bound to the component.

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


[jira] Work stopped: (FELIX-364) 0..1 dynamic service reference does not bind properly.

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

Work on FELIX-364 stopped by Felix Meschberger.

> 0..1 dynamic service reference does not bind properly.
> ------------------------------------------------------
>
>                 Key: FELIX-364
>                 URL: https://issues.apache.org/jira/browse/FELIX-364
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>    Affects Versions: 0.8.0
>         Environment: Java 1.6
>            Reporter: I-Ann Chen
>            Assignee: Felix Meschberger
>         Attachments: patch.txt
>
>
> There are 2 parts to the issue. Both are with a component with a reference to a service where cardinality=0..1 and policy=dynamic.
> 1. If the bundle providing the service is stopped (without another bundle providing the same service) and restarted, the service is not re-bound to the component.
> 2. If the service is started after the component referencing it, then the service is never bound to the component.

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