|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.dependencymanager.ConfigurationDependency
org.apache.felix.dependencymanager.impl.ConfigurationDependencyImpl
public class ConfigurationDependencyImpl
Configuration dependency that can track the availability of a (valid) configuration.
To use it, specify a PID for the configuration. The dependency is always required,
because if it is not, it does not make sense to use the dependency manager. In that
scenario, simply register your service as a ManagedService(Factory)
and
handle everything yourself. Also, only managed services are supported, not factories.
There are a couple of things you need to be aware of when implementing the
updated(Dictionary)
method:
ConfigurationException
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.
Constructor Summary | |
---|---|
ConfigurationDependencyImpl(DependencyManager dm)
|
Method Summary | |
---|---|
ConfigurationDependency |
getDelegate()
|
boolean |
isAvailable()
Returns true if the dependency is available. |
boolean |
isRequired()
Returns true if this a required dependency. |
ConfigurationDependency |
setCallback(String callback)
Sets a callback which will be invoked when the configuration is available. |
ConfigurationDependency |
setPid(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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConfigurationDependencyImpl(DependencyManager dm)
Method Detail |
---|
public ConfigurationDependency getDelegate()
public ConfigurationDependency setCallback(String callback)
ConfigurationDependency
setCallback
in class ConfigurationDependency
callback
- the callback to invoke when the configuration is available
public ConfigurationDependency setPid(String pid)
service.pid
of the configuration you
are depending on.
setPid
in class ConfigurationDependency
public ConfigurationDependency setPropagate(boolean propagate)
setPropagate
in class ConfigurationDependency
public boolean isAvailable()
Dependency
true
if the dependency is available.
isAvailable
in interface Dependency
isAvailable
in class ConfigurationDependency
true
if the dependency is availablepublic boolean isRequired()
Dependency
true
if this a required dependency. Required dependencies
are dependencies that must be available before the service can be activated.
isRequired
in interface Dependency
isRequired
in class ConfigurationDependency
true
if the dependency is required
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |