|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.dm.impl.metatype.MetaTypeProviderImpl
public class MetaTypeProviderImpl
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)
Remove a factory instance. |
String[] |
getLocales()
Returns all the Locales our bundle is containing. |
String |
getName()
Return a descriptive name of this factory. |
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)
Create a new instance, or update the configuration of an existing instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MetaTypeProviderImpl(String pid, BundleContext ctx, Logger logger, ManagedService msDelegate, ManagedServiceFactory msfDelegate)
Method Detail |
---|
public void add(PropertyMetaData property)
property
- public void setDescription(String description)
public void setName(String heading)
public void setLocalization(String path)
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).
public String[] getLocales()
getLocales
in interface MetaTypeProvider
public ObjectClassDefinition getObjectClassDefinition(String id, String locale)
getObjectClassDefinition
in interface MetaTypeProvider
id
- The ID of the requested object class. This can be a pid or
factory pid returned by getPids or getFactoryPids.locale
- The locale of the definition or null
for default
locale.
ObjectClassDefinition
object.public void updated(Dictionary properties) throws ConfigurationException
updated
in interface ManagedService
properties
- A copy of the Configuration properties, or
null
. This argument must not contain the
"service.bundleLocation" property. The value of this property may
be obtained from the Configuration.getBundleLocation
method.
ConfigurationException
- when the update failspublic void deleted(String pid)
ManagedServiceFactory
If this method throws any Exception
, the Configuration
Admin service must catch it and should log it.
The Configuration Admin service must call this method asynchronously.
deleted
in interface ManagedServiceFactory
pid
- the PID of the service to be removedpublic String getName()
ManagedServiceFactory
getName
in interface ManagedServiceFactory
public void updated(String pid, Dictionary properties) throws ConfigurationException
ManagedServiceFactory
Configuration
object is new for the
Managed Service Factory, then create a new factory instance, using the
configuration properties
provided. Else, update the
service instance with the provided properties
.
If the factory instance is registered with the Framework, then the
configuration properties
should be copied to its registry
properties. This is not mandatory and security sensitive properties
should obviously not be copied.
If this method throws any Exception
, the Configuration
Admin service must catch it and should log it.
When the implementation of updated detects any kind of error in the
configuration properties, it should create a new
ConfigurationException
which describes the problem.
The Configuration Admin service must call this method asynchronously.
This implies that implementors of the ManagedServiceFactory
class can be assured that the callback will not take place during
registration when they execute the registration in a synchronized method.
updated
in interface ManagedServiceFactory
pid
- The PID for this configuration.properties
- A copy of the configuration properties. This argument
must not contain the service.bundleLocation" property. The value
of this property may be obtained from the
Configuration.getBundleLocation
method.
ConfigurationException
- when the configuration properties are
invalid.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |