The OSGi core framework also provides a configuration management capability known as Configuration Admin. Configuration Admin provides capabilities to store preference or configuration information based on key value pairs. However, although the OSGi Configuration Admin service is still technically supported by the Lotus Expeditor Client, its use is deprecated, and support is likely to be removed in a future release. You should update any existing components that use Configuration Admin to use Eclipse preferences instead, and use Eclipse preferences for new components.
Applications that use Configuration Admin to store information will need to implement the ManagedService
interface. By implementing this interface, the application will be notified when configuration information changes. Applications that use Configuration Admin to store configuration and preference information can also use the Metatype
service to provide a metadata description of the information. The metadata can describe the parameter types, default values, and validation logic to be applied for each parameter.
If Configuration Admin is used to store configuration information, system administrators can query and update configuration values via the Enterprise Management Agent.
If configuration information is stored using Configuration Admin, preference pages can be used to provide a user interface to view and modify preferences. The Lotus® Expeditor platform provides classes to assist in using preference pages to interact with Configuration Admin.
has subclassed the org.eclipse.jface.preference.FieldEditorPreferencePage
to provide preference pages for configuration information stored within Configuration Admin. The ConfigAdminPreferencePage
creates a ConfigAdminPreferenceStore
, that uses Configuration Admin and Metatype
services to obtain the required data to automatically build the preference page.
To use the ConfigAdminPreferencePage
, you will need to create your own subclass of the ConfigAdminPreferencePage
, and supply the Bundle and Persistent ID for the properties that you intend to display. Within your subclass, you can also affect the set of properties displayed, as well as add your own validation logic to the page. You will also need to define a preference page via the standard Eclipse extension point for preference pages, and supply the appropriate metadata files (i.e. METADATA.XML
). Refer to Using the Meta Type Service
for more information . The METADATA.XML
files are loaded from either the plug-in files or from the plug-in's class path. The METADATA.*
files must be placed within the META-INF
directory of either the project or the src
directory for the project
supports only scalar metatype definitions for non-factory PIDs. Integer, String, and Boolean fields are handled by default. You will need to provide implementations for FieldEditors
for types such as Byte
Refer to the Javadoc information for the com.ibm.eswe.preference
package for more information.
Parent topic: Understanding preference options: XPD621