org.apache.felix.dependencymanager.impl
Class ConfigurationDependencyImpl

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

public class ConfigurationDependencyImpl
extends 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:

Author:
Felix Project Team

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

ConfigurationDependencyImpl

public ConfigurationDependencyImpl(DependencyManager dm)
Method Detail

getDelegate

public ConfigurationDependency getDelegate()

setCallback

public ConfigurationDependency setCallback(String callback)
Description copied from class: ConfigurationDependency
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.

Specified by:
setCallback in class ConfigurationDependency
Parameters:
callback - the callback to invoke when the configuration is available
Returns:
this dependency.

setPid

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

Specified by:
setPid in class ConfigurationDependency

setPropagate

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

Specified by:
setPropagate in class ConfigurationDependency

isAvailable

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

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

isRequired

public 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
Specified by:
isRequired in class ConfigurationDependency
Returns:
true if the dependency is required


Copyright © 2011 Apache Software Foundation. All Rights Reserved.