Enable a service to receive configuration data
To enable a service to receive configuration data, you associate the service with a persisted identity, and code the service to receive the data. We can also provide descriptions and default values for this data, and make the labels and descriptions available in several languages.
To enable a service to receive configuration data, there are a number of steps involved. Only associating the service with a configuration Admin persisted identity and coding the service to receive configuration properties are mandatory, and might be considered sufficient for embedded scenarios. The remaining steps improve the configuration experience for users.
The steps involved in enabling a service to receive configuration data are described in the following subtopics:
Subtopics
- Associate a service with a persisted identity
You associate a set of configuration properties with its consuming component as described in the OSGi Configuration Admin specification using the the persisted identity (PID).
- Coding the service to receive configuration properties
Configuration properties are available through the org.osgi.service.component.ComponentContext object provided on the activation method.
Parent topic: Composing advanced features using OSGi Declarative ServicesConcepts:
Server configuration