aVineas.org aVineas open source Java code

Introduction

The OSGi Configuration Admin service is the standard solution for providing bundles with a run-time configuration. Although the Configuration Admin service specification describes the interface to set and retrieve configuration data, the specification does not specify how the configuration data is persisted.

Since in Java the standard means for storing properties/configuration is by means of property files, the CM persister bundle handles the gap between property files and the Configuration Admin storage: it loads the configuration from property files into the Configuration Admin and updates this configuration if the property files change. Note that synchronization is one-way: updates to the configurations via the Configuration Admin interface are not persisted back into the property files.

Usage

The CM persister bundle looks for property files in a directory provided by the "cm.location" system property. Therefore this directory must be passed when starting the OSGi framework (via the standard Java -D option, like -Dcm.location=/home/configuration). The property files provided in the directory must contain standard property values in the following form:

PID..property=value
where "PID" is the persistence identity of the group of properties for a managed service and "property" is the property identifier. "Value" indicates the property value. Example:
com.acme.console..port=2001

indicates that for PID "com.acme.console" the property "port" must be set to 2001.

Restrictions and other usage hints:

Dependencies

The bundle depends on the standard OSGi core and compendium interfaces. Furthermore, it needs a configuration admin service in the framework to load the configuration(s) in.

Download

org.avineas.cm.persister_2.0.1.jar

Copyright 2010-2024, aVineas IT Consulting