Am Mittwoch, den 05.09.2007, 17:15 +0200 schrieb Carsten Ziegeler:
> Hmm, but as we are also using the metatype service, I thought by
> specifying the metatype:Designate with the metatype:Object element
> inside the metatype.xml, a configuration is created for the service.
> Therefore the configuration should not be new. Or am I misreading the
> spec here?

That is an interesting question. Currently the SCR does not register a
ManagedService on behalf of a component to get the configuration but
directly accesses the Configuration Admin for the configuration - which
is also why a Configuration object is always created for each component.
(This is different for factory components, where a ManagedServiceFactory
is registered on behalf of the factory component)

If SCR would do so, SCR could of course register a ManagedService which
also is a MetaTypeProvider which could use the metatype service to
access its object class definition for default configuration.

But: This has probably no advantage regarding default configuration
because the SCR plugin writes both the metatype file and the component
descriptor with the same default values. So the component is already
provided the default configuration. In addition, having a
MetaTypeProvider would also not help in case there is no MetaType data
(well, the SCR could of course construct this from the component
descriptor ...)

Finally, the Config Admin spec with regard to MetaTypeProvider is rather
unclear as to how this would relate to the other spec, that a never
updated Configuration must return when asked for the properties. Maybe
the intent is to immediately update the newly created configuration with
the MetaTypeProvider default configuration ?

Regards
Felix

Reply via email to