org.apache.felix.dm.impl.metatype
Class MetaTypeProviderImpl

java.lang.Object
  extended by org.apache.felix.dm.impl.metatype.MetaTypeProviderImpl
All Implemented Interfaces:
ManagedService, ManagedServiceFactory, MetaTypeProvider

public class MetaTypeProviderImpl
extends Object
implements MetaTypeProvider, ManagedService, 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.


Constructor Summary
MetaTypeProviderImpl(String pid, BundleContext ctx, Logger logger, ManagedService msDelegate, ManagedServiceFactory msfDelegate)
           
 
Method Summary
 void add(PropertyMetaData property)
          Registers the metatype information of a given configuration property
 void deleted(String pid)
           
 String[] getLocales()
          Returns all the Locales our bundle is containing.
 String getName()
           
 ObjectClassDefinition getObjectClassDefinition(String id, String locale)
          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 setLocalization(String path)
          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(Dictionary properties)
          We also implements the ManagedService and we just delegates the configuration handling to our associated ConfigurationDependency.
 void updated(String pid, Dictionary properties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaTypeProviderImpl

public MetaTypeProviderImpl(String pid,
                            BundleContext ctx,
                            Logger logger,
                            ManagedService msDelegate,
                            ManagedServiceFactory msfDelegate)
Method Detail

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 MetaTypeProvider
Returns:
the list of Locale supported by our bundle.

getObjectClassDefinition

public ObjectClassDefinition getObjectClassDefinition(String id,
                                                      String locale)
Returns the ObjectClassDefinition for a given Pid/Locale.

Specified by:
getObjectClassDefinition in interface MetaTypeProvider

updated

public void updated(Dictionary properties)
             throws ConfigurationException
We also implements the ManagedService and we just delegates the configuration handling to our associated ConfigurationDependency.

Specified by:
updated in interface ManagedService
Throws:
ConfigurationException

deleted

public void deleted(String pid)
Specified by:
deleted in interface ManagedServiceFactory

getName

public String getName()
Specified by:
getName in interface ManagedServiceFactory

updated

public void updated(String pid,
                    Dictionary properties)
             throws ConfigurationException
Specified by:
updated in interface ManagedServiceFactory
Throws:
ConfigurationException


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.