Felix Meschberger schrieb: > Hi all, > > Issue FELIX-354 ([1]) complains, that the ServiceReference properties of > services registered through the SCR do not always contain the > service.pid property. In the Felix implementation, this property is > currently only set if the Configuration Admin service can provide > configuration to the component with the component name used as the PID > because the Configuration Admin service has to set the service.pid in > the configuration (if configuration exists). > > So, this leaves us with a strange situation: > > (1) For services not registered through SCR, the service.pid is of > course only set if the registrar sets the property. > (2) For services registered through SCR, the service.pid property is set > if configuration exists in the Configuration Admin for the service. In > addition these services have the component.name property set. > > While the first case is completely outside of our control (which is > good), I am not sure about the second one: I would like to have the SCR > add the service.pid property to the service registration (if not set > through other means, e.g. the component properties). According to the > spec, the SCR only adds the component.id and component.name properties. > > I wonder, whether it is ok to modify the SCR like this ? > > Or should we rather extend the maven-scr-plugin to generate the > service.pid property automatically from the component name (if not > explicitly set by the user, which would probably not be a good idea) ? > > What do you think ? > I haven't looked briefly at the spec to be honest, but what I find strange is that the component has a pid when viewed in the configuration admin (and the metatype.xml contains an entry for this). It seems (as you write in the jira issue) that this pid is only available in scr if the configuration has been changed once (update() is called). So from a client perspective (someone using this component), it depends if it gets the PID based on the fact if someone has updated the configuration or not. This looks a little bit strange to me.
Carsten -- Carsten Ziegeler [EMAIL PROTECTED]
