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

    Constructors
    Constructor
    Description
    MetaTypeProviderImpl(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 Type
    Method
    Description
    void
    Registers the metatype information of a given configuration property
    void
     
    Returns all the Locales our bundle is containing.
     
    org.osgi.service.metatype.ObjectClassDefinition
    Returns the ObjectClassDefinition for a given Pid/Locale.
    void
    setDescription(String description)
    A human readable description of the PID this annotation is associated with.
    void
    Points to the basename of the Properties file that can localize the Meta Type informations.
    void
    setName(String heading)
    The label used to display the tab name (or section) where the properties are displayed.
    void
    updated(String pid, Dictionary<String,?> properties)
     
    void
    updated(Dictionary<String,?> properties)
    We also implements the ManagedService and we just delegates the configuration handling to our associated ConfigurationDependency.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MetaTypeProviderImpl

      public MetaTypeProviderImpl(String pid, org.osgi.framework.BundleContext ctx, Logger logger, org.osgi.service.cm.ManagedService msDelegate, org.osgi.service.cm.ManagedServiceFactory msfDelegate)
    • MetaTypeProviderImpl

      public MetaTypeProviderImpl(MetaTypeProviderImpl prototype, org.osgi.service.cm.ManagedService msDelegate, org.osgi.service.cm.ManagedServiceFactory msfDelegate)
  • Method Details

    • add

      public void add(PropertyMetaData property)
      Registers the metatype information of a given configuration property
      Parameters:
      property -
    • setDescription

      public void setDescription(String description)
      A human readable description of the PID this annotation is associated with. Example: "Configuration for the PrinterService bundle".
    • setName

      public void setName(String heading)
      The label used to display the tab name (or section) where the properties are displayed. Example: "Printer Service".
    • setLocalization

      public void setLocalization(String path)
      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

      public String[] 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:
      getLocales in interface org.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:
      getObjectClassDefinition in interface org.osgi.service.metatype.MetaTypeProvider
    • updated

      public void updated(Dictionary<String,?> properties) throws org.osgi.service.cm.ConfigurationException
      We also implements the ManagedService and we just delegates the configuration handling to our associated ConfigurationDependency.
      Specified by:
      updated in interface org.osgi.service.cm.ManagedService
      Throws:
      org.osgi.service.cm.ConfigurationException
    • deleted

      public void deleted(String pid)
      Specified by:
      deleted in interface org.osgi.service.cm.ManagedServiceFactory
    • getName

      public String getName()
      Specified by:
      getName in interface org.osgi.service.cm.ManagedServiceFactory
    • updated

      public void updated(String pid, Dictionary<String,?> properties) throws org.osgi.service.cm.ConfigurationException
      Specified by:
      updated in interface org.osgi.service.cm.ManagedServiceFactory
      Throws:
      org.osgi.service.cm.ConfigurationException