Skip to main content

Configurations

The configuration section allows to deploy configuration for the OSGi Configuration Admin service along a set of bundles. Here is an example of such a configuration:

<config name="com.foo.bar">
   myProperty = myValue
</config>

The name attribute of the configuration element will be used as the ManagedService PID for the configuration set in the Configuration Admin service. When using a ManagedServiceFactory, the name attribute is servicePid-_aliasId_, where servicePid is the PID of the ManagedServiceFactory and aliasId is a label used to uniquely identify a particular service (an alias to the factory generated service PID). Deploying such a configuration has the same effect than dropping a file named com.foo.bar.cfg into the etc folder.

The content of the configuration element is set of properties parsed using the standard java property mechanism. Such configuration as usually used with Blueprint support for the Configuration Admin service, but using plain OSGi APIs will of course work the same way:

<bean ...>
   <property name="propertyName" value="${myProperty}" />
</bean>
<osgix:cm-properties id="cmProps" persistent-id="com.foo.bar">
   <prop key="myProperty">myValue</prop>
</osgix:cm-properties>
<ctx:property-placeholder properties-ref="cmProps" />

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!