felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Meschberger <fmesc...@gmail.com>
Subject Re: Declarative Services and service.pid
Date Thu, 06 Sep 2007 06:22:43 GMT
Am Donnerstag, den 06.09.2007, 11:53 +0800 schrieb Niclas Hedhman:
> On Wednesday 05 September 2007 21:08, Felix Meschberger wrote:
> > (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.
> I find this statement strange.
> Services are expected to set their own PID, and the Config Admin does not need 
> to have a Configuration created with that PID in advance. IIRC, the creation 
> of the Configuration instance is asynchronous with everything else.


> And why would there be any difference with Declarative Services? The service 
> itself sets the PID (but the spec should be very clear if this is done 
> declaratively or the SCR does it according to some algorithm, barely up for 
> interpretation) and the SCR have no doing in checking whether Config Admin 
> has already created a Config with that PID...

It is different, because it is SCR which registers the service and
therefore sets up the registration properties and not some activator or

And yes, unfortunately the spec on Declarative Service only uses the PID
when speaking of retrieving the configuration from Configuration Admin.
There is no note as to whether the PID is set and who should set the

So, why is the PID added if configuration is available ? According to
the Config Admin spec, the configuration properties must contain the
service.pid (and others). According to the Declarative Services Spec,
the Configuration properties are added to the component properties. As a
consequence, the PID is added to the properties if configuration is

Finally, agreed, that the SCR should not care for the PID, which is why
I would not actually like such a solution. So, if the PID should be set
- regardless of whether a configuration is available or not - the PID
should be declared as a component property in the descriptor.

There may be an ommission in the spec in this regards ? Maybe I should
just ask on the OSGi dev list ...


View raw message