This topic applies to WebSphere Application Server Liberty V8.5.5.9 and earlier. For the latest Liberty topics, see the WebSphere Application Server Liberty documentation.
Describing configuration by using the OSGi Metatype service
The configuration properties for each service can be described in metadata that complies with the OSGi Metatype Service specification. The metadata can include default values, translatable names and descriptions, and information to allow validation of input values. The resulting XML file is packaged into the bundle that contains your service, in the OSGI-INF/metatype directory, in accordance with the specification.
About this task
Providing metadata to describe your configuration is optional,
but it does provide the following benefits:
- default values can be separated from the implementation code into the metatype XML file where they are easy to locate;
- appropriate data types and other validation data can be specified for each attribute, allowing validation by the configuration parser and developer tools, and simplifying the code you write to process the attributes;
- your configuration will be included in the XML schema that describes the available configuration to the developer tools and other utilities;
- translatable names and descriptions can be provided for each attribute, and will be displayed in the developer tools.