You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2007/09/05 14:21:33 UTC

[jira] Created: (FELIX-354) Service.PID not always available in properties

Service.PID not always available in properties
----------------------------------------------

                 Key: FELIX-354
                 URL: https://issues.apache.org/jira/browse/FELIX-354
             Project: Felix
          Issue Type: Bug
          Components: Declarative Services
            Reporter: Carsten Ziegeler


In some cases, the property Constants.SERVICE_PID is null for a service even if it has a configuration.
Use case:
Two services are registered through SCR, service A has a static reference to service B.
When the bind method in Service A is called with the ServiceReference to B, the SERVICE_PID is null in the properties.
Service B has a configuration and can be configured through the configuration admin (SERVICE_PID is available there).

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


[jira] Closed: (FELIX-354) Service.PID not always available in properties

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

Felix Meschberger closed FELIX-354.
-----------------------------------

    Resolution: Won't Fix

It has been argued, that it is not the task of the SCR to ensure the service.pid property being set. To still have the
service.pid at any point in time the Maven SCR plugin has been modified to ensure the service.pid property is defined if not explicitly set.

Therefore, I close this issue as won't fix.

> Service.PID not always available in properties
> ----------------------------------------------
>
>                 Key: FELIX-354
>                 URL: https://issues.apache.org/jira/browse/FELIX-354
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>            Reporter: Carsten Ziegeler
>            Assignee: Felix Meschberger
>
> In some cases, the property Constants.SERVICE_PID is null for a service even if it has a configuration.
> Use case:
> Two services are registered through SCR, service A has a static reference to service B.
> When the bind method in Service A is called with the ServiceReference to B, the SERVICE_PID is null in the properties.
> Service B has a configuration and can be configured through the configuration admin (SERVICE_PID is available there).

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


[jira] Commented: (FELIX-354) Service.PID not always available in properties

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

Felix Meschberger commented on FELIX-354:
-----------------------------------------

The service.pid property is not set by the SCR. It is either set by the declared component properties or by the configuration properties of there is configuration for the component.

But there is some subtlety here: The ConfigurationAdmin.getConfiguration method always returns a Configuration object - either an existing or a newly created configuration. In the case of a newly created configuration object, the configuration apears to exist but as there has not been any properties set and thus the Configuration.update(Dictionary) method never called, the newly created object returns null instead of an empty Dictionary.

In short, the component properties will not contain any ConfigurationAdmin configuration if the respective configuration object does not return a Dictionary. Therefore, the service.pid is not set. On the other hand, as soon as the Configuration.update(Dictionary) method has been called and the configuration data been stored, the component is cycled and provided with the new configuration data, this time with the service.pid property.

To my understanding, this all works as specified. Still I agree, that it would probably be good to have the service.pid in the service properties and the component properties at all time.

Two solutions come to mind:

(1) Enhance SCR to inject the service.pid if not existing. I am not sure, whether this is ok with the spec
(2) Enhance the maven-scr-plugin to create a service.pid property automatically

Discussing these options in the dev list.

> Service.PID not always available in properties
> ----------------------------------------------
>
>                 Key: FELIX-354
>                 URL: https://issues.apache.org/jira/browse/FELIX-354
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>            Reporter: Carsten Ziegeler
>
> In some cases, the property Constants.SERVICE_PID is null for a service even if it has a configuration.
> Use case:
> Two services are registered through SCR, service A has a static reference to service B.
> When the bind method in Service A is called with the ServiceReference to B, the SERVICE_PID is null in the properties.
> Service B has a configuration and can be configured through the configuration admin (SERVICE_PID is available there).

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


[jira] Assigned: (FELIX-354) Service.PID not always available in properties

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

Felix Meschberger reassigned FELIX-354:
---------------------------------------

    Assignee: Felix Meschberger

> Service.PID not always available in properties
> ----------------------------------------------
>
>                 Key: FELIX-354
>                 URL: https://issues.apache.org/jira/browse/FELIX-354
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>            Reporter: Carsten Ziegeler
>            Assignee: Felix Meschberger
>
> In some cases, the property Constants.SERVICE_PID is null for a service even if it has a configuration.
> Use case:
> Two services are registered through SCR, service A has a static reference to service B.
> When the bind method in Service A is called with the ServiceReference to B, the SERVICE_PID is null in the properties.
> Service B has a configuration and can be configured through the configuration admin (SERVICE_PID is available there).

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