You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Valentin Valchev (JIRA)" <ji...@apache.org> on 2010/04/16 09:27:24 UTC

[jira] Created: (FELIX-2288) Felix SCR API problem/misunderstanding

Felix SCR API problem/misunderstanding
--------------------------------------

                 Key: FELIX-2288
                 URL: https://issues.apache.org/jira/browse/FELIX-2288
             Project: Felix
          Issue Type: Bug
          Components: Declarative Services (SCR), Web Console
            Reporter: Valentin Valchev
            Priority: Critical


I've been playing with the Components plugin of the Web Console and it work perfectly with the Felix SCR implementation. When I switched to ProSyst/Equinox implementation (they are basically the same) I found a small problem.

When I disable a component, it's ID becomes -1 and I cannot enable it anymore. As long as I disable components all their IDs becomes -1.

I opened the OSGi r4.2 specification to see if there is a reason for this behaviour. The JavaDoc for ComponentConstants states for the component ID, that 
"The value of this property is assigned by the Service Component Runtime when a component configuration is created."

In part 112.6 Component Properties, the specification says, that 'component.id' property is always added by the SCR but for "Each component configuration".

When a component is disabled or uninstalled, there is no configuration - it's just a component definition. So the SCR is not required to assign ID.


As for the Web Console we can easily fix the problem by using the pair bundle + component name for identification, instead of ID. However, since Apache SCR API is becoming recommended OSGi API, it would be better to define a mature and compatible API.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (FELIX-2288) Felix SCR API problem/misunderstanding

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

Felix Meschberger resolved FELIX-2288.
--------------------------------------

    Resolution: Fixed

This works for me now; thus resolving this issue.

> Felix SCR API problem/misunderstanding
> --------------------------------------
>
>                 Key: FELIX-2288
>                 URL: https://issues.apache.org/jira/browse/FELIX-2288
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR), Web Console
>    Affects Versions: scr-1.0.0, scr-1.0.2, scr-1.0.4, scr-1.0.6, scr-1.0.8, scr-1.2.0,  scr-1.4.0, webconsole-3.1.0
>            Reporter: Valentin Valchev
>            Assignee: Felix Meschberger
>            Priority: Critical
>             Fix For:  scr-1.4.2, webconsole-3.1.2
>
>
> I've been playing with the Components plugin of the Web Console and it work perfectly with the Felix SCR implementation. When I switched to ProSyst/Equinox implementation (they are basically the same) I found a small problem.
> When I disable a component, it's ID becomes -1 and I cannot enable it anymore. As long as I disable components all their IDs becomes -1.
> I opened the OSGi r4.2 specification to see if there is a reason for this behaviour. The JavaDoc for ComponentConstants states for the component ID, that 
> "The value of this property is assigned by the Service Component Runtime when a component configuration is created."
> In part 112.6 Component Properties, the specification says, that 'component.id' property is always added by the SCR but for "Each component configuration".
> When a component is disabled or uninstalled, there is no configuration - it's just a component definition. So the SCR is not required to assign ID.
> As for the Web Console we can easily fix the problem by using the pair bundle + component name for identification, instead of ID. However, since Apache SCR API is becoming recommended OSGi API, it would be better to define a mature and compatible API.

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


[jira] Updated: (FELIX-2288) Felix SCR API problem/misunderstanding

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

Felix Meschberger updated FELIX-2288:
-------------------------------------

             Assignee: Felix Meschberger
        Fix Version/s:  scr-1.4.2
                       webconsole-3.1.2
    Affects Version/s: webconsole-3.1.0
                        scr-1.4.0
                       scr-1.2.0
                       scr-1.0.8
                       scr-1.0.6
                       scr-1.0.4
                       scr-1.0.2
                       scr-1.0.0

> Felix SCR API problem/misunderstanding
> --------------------------------------
>
>                 Key: FELIX-2288
>                 URL: https://issues.apache.org/jira/browse/FELIX-2288
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR), Web Console
>    Affects Versions: scr-1.0.0, scr-1.0.2, scr-1.0.4, scr-1.0.6, scr-1.0.8, scr-1.2.0,  scr-1.4.0, webconsole-3.1.0
>            Reporter: Valentin Valchev
>            Assignee: Felix Meschberger
>            Priority: Critical
>             Fix For:  scr-1.4.2, webconsole-3.1.2
>
>
> I've been playing with the Components plugin of the Web Console and it work perfectly with the Felix SCR implementation. When I switched to ProSyst/Equinox implementation (they are basically the same) I found a small problem.
> When I disable a component, it's ID becomes -1 and I cannot enable it anymore. As long as I disable components all their IDs becomes -1.
> I opened the OSGi r4.2 specification to see if there is a reason for this behaviour. The JavaDoc for ComponentConstants states for the component ID, that 
> "The value of this property is assigned by the Service Component Runtime when a component configuration is created."
> In part 112.6 Component Properties, the specification says, that 'component.id' property is always added by the SCR but for "Each component configuration".
> When a component is disabled or uninstalled, there is no configuration - it's just a component definition. So the SCR is not required to assign ID.
> As for the Web Console we can easily fix the problem by using the pair bundle + component name for identification, instead of ID. However, since Apache SCR API is becoming recommended OSGi API, it would be better to define a mature and compatible API.

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


[jira] Commented: (FELIX-2288) Felix SCR API problem/misunderstanding

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

Felix Meschberger commented on FELIX-2288:
------------------------------------------

Fixed handling of the component ID in the Declarative Services bundle in Rev. 981772: The ID is now only generated and assigned to a component while the component is enabled. To still access components without an assigned ID, ScrService gets a new method getComponent(String name) to access components by their name.

This also increases the version of the SCR management API to 1.6 (Rev. 981782)

> Felix SCR API problem/misunderstanding
> --------------------------------------
>
>                 Key: FELIX-2288
>                 URL: https://issues.apache.org/jira/browse/FELIX-2288
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR), Web Console
>            Reporter: Valentin Valchev
>            Priority: Critical
>
> I've been playing with the Components plugin of the Web Console and it work perfectly with the Felix SCR implementation. When I switched to ProSyst/Equinox implementation (they are basically the same) I found a small problem.
> When I disable a component, it's ID becomes -1 and I cannot enable it anymore. As long as I disable components all their IDs becomes -1.
> I opened the OSGi r4.2 specification to see if there is a reason for this behaviour. The JavaDoc for ComponentConstants states for the component ID, that 
> "The value of this property is assigned by the Service Component Runtime when a component configuration is created."
> In part 112.6 Component Properties, the specification says, that 'component.id' property is always added by the SCR but for "Each component configuration".
> When a component is disabled or uninstalled, there is no configuration - it's just a component definition. So the SCR is not required to assign ID.
> As for the Web Console we can easily fix the problem by using the pair bundle + component name for identification, instead of ID. However, since Apache SCR API is becoming recommended OSGi API, it would be better to define a mature and compatible API.

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


[jira] Commented: (FELIX-2288) Felix SCR API problem/misunderstanding

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

Felix Meschberger commented on FELIX-2288:
------------------------------------------

Yes, I agree (and this may well be an issue in the Apache Felix DS implementation).

In fact our DS implementation actually assigns the ID when the component configuration (file) is read and internal data structure is created. And over the lifecycle of the data structure, the ID is fixed -- this is probably fundamentally wrong.

So, yes, the API must be clarified for the Component.getId() method to only return a positive number if the component is enabled (or active).
And, yes, the Felix DS implementation should be fixed
And, yes, using the component name if the id is not valid sounds good to me.

> Felix SCR API problem/misunderstanding
> --------------------------------------
>
>                 Key: FELIX-2288
>                 URL: https://issues.apache.org/jira/browse/FELIX-2288
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR), Web Console
>            Reporter: Valentin Valchev
>            Priority: Critical
>
> I've been playing with the Components plugin of the Web Console and it work perfectly with the Felix SCR implementation. When I switched to ProSyst/Equinox implementation (they are basically the same) I found a small problem.
> When I disable a component, it's ID becomes -1 and I cannot enable it anymore. As long as I disable components all their IDs becomes -1.
> I opened the OSGi r4.2 specification to see if there is a reason for this behaviour. The JavaDoc for ComponentConstants states for the component ID, that 
> "The value of this property is assigned by the Service Component Runtime when a component configuration is created."
> In part 112.6 Component Properties, the specification says, that 'component.id' property is always added by the SCR but for "Each component configuration".
> When a component is disabled or uninstalled, there is no configuration - it's just a component definition. So the SCR is not required to assign ID.
> As for the Web Console we can easily fix the problem by using the pair bundle + component name for identification, instead of ID. However, since Apache SCR API is becoming recommended OSGi API, it would be better to define a mature and compatible API.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (FELIX-2288) Felix SCR API problem/misunderstanding

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

Felix Meschberger closed FELIX-2288.
------------------------------------


Apache Felix Declarative Services 1.6.0 has been released. The issues are now closed.

> Felix SCR API problem/misunderstanding
> --------------------------------------
>
>                 Key: FELIX-2288
>                 URL: https://issues.apache.org/jira/browse/FELIX-2288
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR), Web Console
>    Affects Versions: scr-1.0.0, scr-1.0.2, scr-1.0.4, scr-1.0.6, scr-1.0.8, scr-1.2.0,  scr-1.4.0, webconsole-3.1.0
>            Reporter: Valentin Valchev
>            Assignee: Felix Meschberger
>            Priority: Critical
>             Fix For:  scr-1.6.0, webconsole-3.1.2
>
>
> I've been playing with the Components plugin of the Web Console and it work perfectly with the Felix SCR implementation. When I switched to ProSyst/Equinox implementation (they are basically the same) I found a small problem.
> When I disable a component, it's ID becomes -1 and I cannot enable it anymore. As long as I disable components all their IDs becomes -1.
> I opened the OSGi r4.2 specification to see if there is a reason for this behaviour. The JavaDoc for ComponentConstants states for the component ID, that 
> "The value of this property is assigned by the Service Component Runtime when a component configuration is created."
> In part 112.6 Component Properties, the specification says, that 'component.id' property is always added by the SCR but for "Each component configuration".
> When a component is disabled or uninstalled, there is no configuration - it's just a component definition. So the SCR is not required to assign ID.
> As for the Web Console we can easily fix the problem by using the pair bundle + component name for identification, instead of ID. However, since Apache SCR API is becoming recommended OSGi API, it would be better to define a mature and compatible API.

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


[jira] Commented: (FELIX-2288) Felix SCR API problem/misunderstanding

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

Felix Meschberger commented on FELIX-2288:
------------------------------------------

Fixed the Web Console in Rev. 981795 by adding support for components whose component ID is not assigned. Instead of the component ID a combination of the component name and the service.pid property assigned to the component is used. If the service.pid property is not assigned to the component, just the component name is used.

> Felix SCR API problem/misunderstanding
> --------------------------------------
>
>                 Key: FELIX-2288
>                 URL: https://issues.apache.org/jira/browse/FELIX-2288
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR), Web Console
>            Reporter: Valentin Valchev
>            Priority: Critical
>
> I've been playing with the Components plugin of the Web Console and it work perfectly with the Felix SCR implementation. When I switched to ProSyst/Equinox implementation (they are basically the same) I found a small problem.
> When I disable a component, it's ID becomes -1 and I cannot enable it anymore. As long as I disable components all their IDs becomes -1.
> I opened the OSGi r4.2 specification to see if there is a reason for this behaviour. The JavaDoc for ComponentConstants states for the component ID, that 
> "The value of this property is assigned by the Service Component Runtime when a component configuration is created."
> In part 112.6 Component Properties, the specification says, that 'component.id' property is always added by the SCR but for "Each component configuration".
> When a component is disabled or uninstalled, there is no configuration - it's just a component definition. So the SCR is not required to assign ID.
> As for the Web Console we can easily fix the problem by using the pair bundle + component name for identification, instead of ID. However, since Apache SCR API is becoming recommended OSGi API, it would be better to define a mature and compatible API.

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