|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.dependencymanager.ConfigurationDependency
public abstract class ConfigurationDependency
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 | |
---|---|
ConfigurationDependency()
|
Method Summary | |
---|---|
abstract boolean |
isAvailable()
Returns true if the dependency is available. |
abstract boolean |
isRequired()
Returns true if this a required dependency. |
abstract ConfigurationDependency |
setCallback(String callback)
Sets a callback which will be invoked when the configuration is available. |
abstract ConfigurationDependency |
setPid(String pid)
Sets the service.pid of the configuration you
are depending on. |
abstract 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 ConfigurationDependency()
Method Detail |
---|
public abstract ConfigurationDependency setCallback(String callback)
callback
- the callback to invoke when the configuration is available
public abstract ConfigurationDependency setPid(String pid)
service.pid
of the configuration you
are depending on.
public abstract ConfigurationDependency setPropagate(boolean propagate)
public abstract boolean isAvailable()
Dependency
true
if the dependency is available.
isAvailable
in interface Dependency
true
if the dependency is availablepublic abstract 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
true
if the dependency is required
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |