The following example illustrates the usage of the extended metatype support, and in particular of the Metadata Manager service.
The example consists of the several parts:
Metadata can be defined as a Metatype Provider service in the OSGi framework. Following is an example provider for the "Server" type, which defines a client application.
The ServerMetadataPlugin class combines the functionality of a Metadata Plugin – it registers an com.prosyst.mbs.services.metatype.MetaDataPlugin, and of a metadata management application – it listens for changed XML-defined metadata and for Metatype Provider services with registration property "metadata.type" equal to "Server". On detecting changes, the ServerMedataPlugin class checks the "isServer" and "port" attributes and logs the result.
This chapter contains an example for defining metadata in an XML file. Shown XML metadata is of the "Server" type and indicates that this is a server application.