public interface ConfigurationDependency extends Dependency, ComponentDependencyDeclaration
ManagedService(Factory) and handle everything yourself. Also,
only managed services are supported, not factories. If you need support for factories, then
you can use
DependencyManager.createFactoryConfigurationAdapterService(String, String, boolean).
There are a couple of things you need to be aware of when implementing the
updated(Dictionary) method:
ConfigurationException or any other exception when you
get a configuration that is invalid. In this case, the dependency will not change:
if it was not available, it will still not be. If it was available, it will remain available
and implicitly assume you keep working with your old configuration.
STATE_AVAILABLE_OPTIONAL, STATE_AVAILABLE_REQUIRED, STATE_NAMES, STATE_OPTIONAL, STATE_REQUIRED, STATE_UNAVAILABLE_OPTIONAL, STATE_UNAVAILABLE_REQUIRED| Modifier and Type | Method and Description |
|---|---|
ConfigurationDependency |
add(PropertyMetaData properties)
Adds a MetaData regarding a given configuration property.
|
ConfigurationDependency |
setCallback(java.lang.Object instance,
java.lang.String callback)
Sets the name of the callback method that should be invoked when a configuration
is available.
|
ConfigurationDependency |
setCallback(java.lang.Object instance,
java.lang.String callback,
boolean needsInstance)
Sets the name of the callback method that should be invoked when a configuration
is available.
|
ConfigurationDependency |
setCallback(java.lang.String callback)
Sets the name of the callback method that should be invoked when a configuration
is available.
|
ConfigurationDependency |
setDescription(java.lang.String description)
A human readable description of the PID this configuration is associated
with.
|
ConfigurationDependency |
setHeading(java.lang.String heading)
The label used to display the tab name (or section) where the properties
are displayed.
|
ConfigurationDependency |
setLocalization(java.lang.String path)
Points to the basename of the Properties file that can localize the Meta
Type informations.
|
ConfigurationDependency |
setPid(java.lang.String pid)
Sets the
service.pid of the configuration you are depending
on. |
ConfigurationDependency |
setPropagate(boolean propagate)
Sets propagation of the configuration properties to the service
properties.
|
getAutoConfigName, getProperties, isAutoConfig, isAvailable, isPropagated, isRequiredgetFilter, getName, getSimpleName, getState, getTypeConfigurationDependency setCallback(java.lang.String callback)
ManagedService.updated(Dictionary) throws ConfigurationException.
By default, if this method is not called, the callback name is "updated".
The callback is always invoked with an already instantiated component (the component implementation class(es) are
always instantiated before the updated callback is invoked).callback - the name of the callback methodConfigurationDependency setCallback(java.lang.Object instance, java.lang.String callback)
ManagedService.updated(Dictionary) throws ConfigurationException.
The callback is called with a component that is not yet instantiated. This allows factory objects to get
injected with a configuration before its create method is called.instance - the instance to call the callbacks oncallback - the name of the callback methodConfigurationDependency setCallback(java.lang.Object instance, java.lang.String callback, boolean needsInstance)
ManagedService.updated(Dictionary) throws ConfigurationException.
The component instance is instantiated before the callback is invoked only the the needsInstance parameter is set to true.instance - the instance to call the callback oncallback - the name of the callback methodneedsInstance - true if the component implementation class(es) must be created before the
callback instance is invoked, else false.ConfigurationDependency setPid(java.lang.String pid)
service.pid of the configuration you are depending
on.ConfigurationDependency setPropagate(boolean propagate)
ConfigurationDependency setHeading(java.lang.String heading)
ConfigurationDependency setDescription(java.lang.String description)
ConfigurationDependency setLocalization(java.lang.String path)
setLocalization("person") will match person_du_NL.properties
in the root bundle directory.ConfigurationDependency add(PropertyMetaData properties)