org.apache.felix.dm
Interface BundleDependency

All Superinterfaces:
ComponentDependencyDeclaration, Dependency
All Known Implementing Classes:
BundleDependencyImpl

public interface BundleDependency
extends Dependency, ComponentDependencyDeclaration


Field Summary
 
Fields inherited from interface org.apache.felix.dm.ComponentDependencyDeclaration
STATE_AVAILABLE_OPTIONAL, STATE_AVAILABLE_REQUIRED, STATE_NAMES, STATE_UNAVAILABLE_OPTIONAL, STATE_UNAVAILABLE_REQUIRED
 
Method Summary
 BundleDependency setAutoConfig(boolean autoConfig)
          Enables auto configuration for this dependency.
 BundleDependency setBundle(Bundle bundle)
          Sets the bundle to depend on directly.
 BundleDependency setCallbacks(Object instance, String added, String removed)
          Sets the callbacks for this dependency.
 BundleDependency setCallbacks(Object instance, String added, String changed, String removed)
          Sets the callbacks for this dependency.
 BundleDependency setCallbacks(String added, String removed)
          Sets the callbacks for this dependency.
 BundleDependency setCallbacks(String added, String changed, String removed)
          Sets the callbacks for this dependency.
 BundleDependency setFilter(String filter)
          Sets the filter condition to depend on.
 BundleDependency setInstanceBound(boolean isInstanceBound)
          Sets the dependency to be bound to this instance.
 BundleDependency setPropagate(boolean propagate)
          Sets property propagation.
 BundleDependency setRequired(boolean required)
          Sets the dependency to be required.
 BundleDependency setStateMask(int mask)
          Sets the bundle state mask to depend on.
 
Methods inherited from interface org.apache.felix.dm.Dependency
createCopy, getAutoConfigInstance, getAutoConfigName, getAutoConfigType, getProperties, invokeAdded, invokeRemoved, isAutoConfig, isAvailable, isInstanceBound, isPropagated, isRequired
 
Methods inherited from interface org.apache.felix.dm.ComponentDependencyDeclaration
getName, getState, getType
 

Method Detail

setCallbacks

BundleDependency setCallbacks(String added,
                              String removed)
Sets the callbacks for this dependency. These callbacks can be used as hooks whenever a dependency is added or removed. When you specify callbacks, the auto configuration feature is automatically turned off, because we're assuming you don't need it in this case.

Parameters:
added - the method to call when a bundle was added
removed - the method to call when a bundle was removed
Returns:
the bundle dependency

setCallbacks

BundleDependency setCallbacks(String added,
                              String changed,
                              String removed)
Sets the callbacks for this dependency. These callbacks can be used as hooks whenever a dependency is added, changed or removed. When you specify callbacks, the auto configuration feature is automatically turned off, because we're assuming you don't need it in this case.

Parameters:
added - the method to call when a bundle was added
changed - the method to call when a bundle was changed
removed - the method to call when a bundle was removed
Returns:
the bundle dependency

setCallbacks

BundleDependency setCallbacks(Object instance,
                              String added,
                              String removed)
Sets the callbacks for this dependency. These callbacks can be used as hooks whenever a dependency is added or removed. They are called on the instance you provide. When you specify callbacks, the auto configuration feature is automatically turned off, because we're assuming you don't need it in this case.

Parameters:
instance - the instance to call the callbacks on
added - the method to call when a bundle was added
removed - the method to call when a bundle was removed
Returns:
the bundle dependency

setCallbacks

BundleDependency setCallbacks(Object instance,
                              String added,
                              String changed,
                              String removed)
Sets the callbacks for this dependency. These callbacks can be used as hooks whenever a dependency is added, changed or removed. They are called on the instance you provide. When you specify callbacks, the auto configuration feature is automatically turned off, because we're assuming you don't need it in this case.

Parameters:
instance - the instance to call the callbacks on
added - the method to call when a bundle was added
changed - the method to call when a bundle was changed
removed - the method to call when a bundle was removed
Returns:
the bundle dependency

setAutoConfig

BundleDependency setAutoConfig(boolean autoConfig)
Enables auto configuration for this dependency. This means the component implementation (composition) will be injected with this bundle dependency automatically.

Parameters:
autoConfig - true to enable auto configuration
Returns:
the bundle dependency

setRequired

BundleDependency setRequired(boolean required)
Sets the dependency to be required.

Parameters:
required - true if this bundle dependency is required
Returns:
the bundle dependency

setBundle

BundleDependency setBundle(Bundle bundle)
Sets the bundle to depend on directly.

Parameters:
bundle - the bundle to depend on
Returns:
the bundle dependency

setFilter

BundleDependency setFilter(String filter)
                           throws IllegalArgumentException
Sets the filter condition to depend on. Filters are matched against the full manifest of a bundle.

Parameters:
filter - the filter condition
Returns:
the bundle dependency
Throws:
IllegalArgumentException

setStateMask

BundleDependency setStateMask(int mask)
Sets the bundle state mask to depend on. The OSGi BundleTracker explains this mask in more detail, but it is basically a mask with flags for each potential state a bundle can be in.

Parameters:
mask - the mask to use
Returns:
the bundle dependency

setPropagate

BundleDependency setPropagate(boolean propagate)
Sets property propagation. If set to true any bundle manifest properties will be added to the service properties of the component that has this dependency (if it registers as a service).

Parameters:
propagate - true to propagate the bundle manifest properties
Returns:
the bundle dependency

setInstanceBound

BundleDependency setInstanceBound(boolean isInstanceBound)
Sets the dependency to be bound to this instance. An instance bound dependency means the component is kept alive even if the dependency goes away, which internally means you can keep your state until you get activated again. This is mainly used when declaring additional dependencies from within the init life cycle method of a component.

Parameters:
isInstanceBound - true if this dependency is instance bound
Returns:
the bundle dependency


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.