Previous Topic

Next Topic

Book Contents

Book Index

Overview

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:

  1. MetaTypeProvider Implementation

    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.

  2. Management Metadata Plugin

    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.

  3. XML-Based Metadata

    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.