Class MetaTypeProviderImpl
java.lang.Object
org.apache.felix.dm.impl.metatype.MetaTypeProviderImpl
- All Implemented Interfaces:
org.osgi.service.cm.ManagedService,org.osgi.service.cm.ManagedServiceFactory,org.osgi.service.metatype.MetaTypeProvider
public class MetaTypeProviderImpl
extends Object
implements org.osgi.service.metatype.MetaTypeProvider, org.osgi.service.cm.ManagedService, org.osgi.service.cm.ManagedServiceFactory
When a ConfigurationDepdendency is configured with properties metadata, we provide
a specific ManagedService which also implements the MetaTypeProvider interface. This interface
allows the MetaTypeService to retrieve our properties metadata, which will then be handled by webconsole.
- Author:
- Felix Project Team
-
Field Summary
Fields inherited from interface org.osgi.service.metatype.MetaTypeProvider
METATYPE_FACTORY_PID, METATYPE_PID -
Constructor Summary
ConstructorsConstructorDescriptionMetaTypeProviderImpl(String pid, org.osgi.framework.BundleContext ctx, Logger logger, org.osgi.service.cm.ManagedService msDelegate, org.osgi.service.cm.ManagedServiceFactory msfDelegate) MetaTypeProviderImpl(MetaTypeProviderImpl prototype, org.osgi.service.cm.ManagedService msDelegate, org.osgi.service.cm.ManagedServiceFactory msfDelegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(PropertyMetaData property) Registers the metatype information of a given configuration propertyvoidString[]Returns all the Locales our bundle is containing.getName()org.osgi.service.metatype.ObjectClassDefinitiongetObjectClassDefinition(String id, String locale) Returns the ObjectClassDefinition for a given Pid/Locale.voidsetDescription(String description) A human readable description of the PID this annotation is associated with.voidsetLocalization(String path) Points to the basename of the Properties file that can localize the Meta Type informations.voidThe label used to display the tab name (or section) where the properties are displayed.voidupdated(String pid, Dictionary<String, ?> properties) voidupdated(Dictionary<String, ?> properties) We also implements the ManagedService and we just delegates the configuration handling to our associated ConfigurationDependency.
-
Constructor Details
-
MetaTypeProviderImpl
-
MetaTypeProviderImpl
public MetaTypeProviderImpl(MetaTypeProviderImpl prototype, org.osgi.service.cm.ManagedService msDelegate, org.osgi.service.cm.ManagedServiceFactory msfDelegate)
-
-
Method Details
-
add
Registers the metatype information of a given configuration property- Parameters:
property-
-
setDescription
A human readable description of the PID this annotation is associated with. Example: "Configuration for the PrinterService bundle". -
setName
The label used to display the tab name (or section) where the properties are displayed. Example: "Printer Service". -
setLocalization
Points to the basename of the Properties file that can localize the Meta Type informations. By default, (e.g.setLocalization("person")would match person_du_NL.properties in the root bundle directory. The default localization base name for the properties is OSGI-INF/l10n/bundle, but can be overridden by the manifest Bundle-Localization header (see core specification, in section Localization on page 68). -
getLocales
Returns all the Locales our bundle is containing. For instance, if our bundle contains the following localization files: OSGI-INF/l10n/bundle_en_GB_welsh.properties and OSGI-INF/l10n/bundle_en_GB.properties, then this method will return "en_GB", "en_GB_welsh" ...- Specified by:
getLocalesin interfaceorg.osgi.service.metatype.MetaTypeProvider- Returns:
- the list of Locale supported by our bundle.
-
getObjectClassDefinition
public org.osgi.service.metatype.ObjectClassDefinition getObjectClassDefinition(String id, String locale) Returns the ObjectClassDefinition for a given Pid/Locale.- Specified by:
getObjectClassDefinitionin interfaceorg.osgi.service.metatype.MetaTypeProvider
-
updated
public void updated(Dictionary<String, ?> properties) throws org.osgi.service.cm.ConfigurationExceptionWe also implements the ManagedService and we just delegates the configuration handling to our associated ConfigurationDependency.- Specified by:
updatedin interfaceorg.osgi.service.cm.ManagedService- Throws:
org.osgi.service.cm.ConfigurationException
-
deleted
- Specified by:
deletedin interfaceorg.osgi.service.cm.ManagedServiceFactory
-
getName
- Specified by:
getNamein interfaceorg.osgi.service.cm.ManagedServiceFactory
-
updated
public void updated(String pid, Dictionary<String, ?> properties) throws org.osgi.service.cm.ConfigurationException- Specified by:
updatedin interfaceorg.osgi.service.cm.ManagedServiceFactory- Throws:
org.osgi.service.cm.ConfigurationException
-