The OSGi Configuration Admin Service allows bundles to persistently store their configurations. The OSGi Meta Type Specification allows for a programmatic description of a bundle's metadata. The OSGi Meta Type
Service ties those two pieces together and enables an administrative bundle to dynamically discover what another bundle's configuration looks like and make changes to it. Note that although the OSGi Configuration Admin and Meta Type services are technically supported by the Lotus® Expeditor Client, their use is deprecated, and support is likely to be removed in a future release. You should update any existing components that use Configuration Admin and the Meta Type service to use Eclipse preferences instead, and use Eclipse preferences for new components.
Service acts as a middle-man between an administrative bundle and a configurable bundle. The admin bundle may ask the MetaType
Service for a MetaType
Provider for a given bundle object. The MetaType
Provider can then be queried to discover the Object Class Definitions and Attribute Definitions contained within.
For this scheme to work, configurable bundles must provide a way for the MetaType Service to discover the bundle's configuration information. Each configurable bundle must have a METADATA.XML
file in the /META-INF
directory of their plug-in/bundle. This METADATA.XML
file contains a description of the configuration in XML format and is packaged in the bundle's JAR file.
This file describes the data in a format defined by METADATA.DTD
. Within the METADATA.XML
file is a list of all supported Locales. An additional set of files, METADATA_<locale>.properties
should contain the translatable strings for a locale in key=value
format. The METADATA.XML
file contains strings for the default language only, which are used by default if the properties file for the desired locale can not be found.
The Meta Type Service is registered with OSGi under the class name org.osgi.service.metatype.MetaTypeService
and provides a way to define and retrieve org.osgi.service.metatype.MetaTypeProvider
objects for an OSGi bundle. For more information on the package org.osgi.service.metatype
see the OSGi Release 4 specification. The MetaTypeProvider
data for each bundle is stored as a bundle resource at /META-INF/METADATA.XML
The Meta Type data stored in /META-INF/METADATA.XML
is used to define information on how to configure a bundle using the OSGi service org.osgi.service.cm.ConfigurationAdmin
. For example, the Managed Service PIDs, the Managed Service Factory PIDs, and the Attributes associated are defined in the METADATA.XML
Parent topic: Enabling applications for configuration: XPD622