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.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, isRequired
getFilter, getName, getSimpleName, getState, getType
ConfigurationDependency setCallback(java.lang.String callback)
ManagedService.updated(Dictionary) throws ConfigurationException
.
By default, if this method is not called, the callback name is "updated".callback
- the name of the callback methodConfigurationDependency setCallback(java.lang.Object instance, java.lang.String callback)
ManagedService.updated(Dictionary) throws ConfigurationException
.instance
- the instance to call the callbacks oncallback
- the name of the callback methodConfigurationDependency 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)