org.apache.felix.dependencymanager
Class ConfigurationDependency

java.lang.Object
  extended by org.apache.felix.dependencymanager.ConfigurationDependency
All Implemented Interfaces:
Dependency
Direct Known Subclasses:
ConfigurationDependencyImpl

public abstract class ConfigurationDependency
extends Object
implements Dependency

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:

Author:
Felix Project Team

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

ConfigurationDependency

public ConfigurationDependency()
Method Detail

setCallback

public abstract ConfigurationDependency setCallback(String callback)
Sets a callback which will be invoked when the configuration is available. The method may take in parameter a Dictionary and may also throw a ConfigurationException.

Parameters:
callback - the callback to invoke when the configuration is available
Returns:
this dependency.

setPid

public abstract ConfigurationDependency setPid(String pid)
Sets the service.pid of the configuration you are depending on.


setPropagate

public abstract ConfigurationDependency setPropagate(boolean propagate)
Sets propagation of the configuration properties to the service properties. Any additional service properties specified directly are merged with these.


isAvailable

public abstract boolean isAvailable()
Description copied from interface: Dependency
Returns true if the dependency is available.

Specified by:
isAvailable in interface Dependency
Returns:
true if the dependency is available

isRequired

public abstract boolean isRequired()
Description copied from interface: Dependency
Returns true if this a required dependency. Required dependencies are dependencies that must be available before the service can be activated.

Specified by:
isRequired in interface Dependency
Returns:
true if the dependency is required


Copyright © 2011 Apache Software Foundation. All Rights Reserved.