|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.dm.impl.dependencies.DependencyBase
org.apache.felix.dm.impl.dependencies.BundleDependencyImpl
public class BundleDependencyImpl
Field Summary |
---|
Fields inherited from class org.apache.felix.dm.impl.dependencies.DependencyBase |
---|
m_logger |
Fields inherited from interface org.apache.felix.dm.ComponentDependencyDeclaration |
---|
STATE_AVAILABLE_OPTIONAL, STATE_AVAILABLE_REQUIRED, STATE_NAMES, STATE_UNAVAILABLE_OPTIONAL, STATE_UNAVAILABLE_REQUIRED |
Constructor Summary | |
---|---|
BundleDependencyImpl(BundleContext context,
Logger logger)
|
|
BundleDependencyImpl(BundleDependencyImpl prototype)
|
Method Summary | |
---|---|
void |
addedBundle(Bundle bundle,
BundleEvent event,
Object object)
marrs: A bundle has been added to the BundleTracker. |
Object |
addingBundle(Bundle bundle,
BundleEvent event)
A bundle is being added to the BundleTracker . |
Dependency |
createCopy()
Creates a copy of this dependency, cloning all declared state, but not the runtime state. |
Object |
getAutoConfigInstance()
Returns the instance that is injected. |
String |
getAutoConfigName()
Returns the name of the member in the class of the component instance to inject into. |
Class |
getAutoConfigType()
Returns the type of the instance that is injected. |
Bundle |
getBundle()
|
String |
getName()
Returns the name of this dependency. |
Dictionary |
getProperties()
|
int |
getState()
Returns the state of this dependency. |
String |
getType()
Returns the name of the type of this dependency. |
void |
invoke(DependencyService dependencyService,
Bundle service,
String name)
|
void |
invokeAdded(DependencyService service)
Invoke the "added" callback on a required dependency. |
void |
invokeAdded(DependencyService dependencyService,
Bundle service)
|
void |
invokeChanged(DependencyService dependencyService,
Bundle service)
|
void |
invokeRemoved(DependencyService service)
Invoke the "removed" callback on a required dependency. |
void |
invokeRemoved(DependencyService dependencyService,
Bundle service)
|
boolean |
isAutoConfig()
Returns true>code> if auto configuration is enabled for this dependency. |
boolean |
isAvailable()
Returns true if the dependency is available. |
boolean |
isPropagated()
|
Bundle |
lookupBundle()
|
void |
modifiedBundle(Bundle bundle,
BundleEvent event,
Object object)
A bundle tracked by the BundleTracker has been modified. |
void |
removedBundle(Bundle bundle,
BundleEvent event,
Object object)
A bundle tracked by the BundleTracker has been removed. |
BundleDependency |
setAutoConfig(boolean autoConfig)
Enables auto configuration for this dependency. |
BundleDependency |
setAutoConfig(String instanceName)
|
BundleDependency |
setBundle(Bundle bundle)
Sets the bundle to depend on directly. |
BundleDependency |
setCallbacks(Object instance,
String added,
String removed)
Sets the callbacks for this service. |
BundleDependency |
setCallbacks(Object instance,
String added,
String changed,
String removed)
Sets the callbacks for this service. |
BundleDependency |
setCallbacks(String added,
String removed)
Sets the callbacks for this service. |
BundleDependency |
setCallbacks(String added,
String changed,
String removed)
Sets the callbacks for this service. |
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 |
setPropagate(Object instance,
String method)
|
BundleDependency |
setRequired(boolean required)
Sets the dependency to be required. |
BundleDependency |
setStateMask(int mask)
Sets the bundle state mask to depend on. |
void |
start(DependencyService service)
|
void |
stop(DependencyService service)
|
Methods inherited from class org.apache.felix.dm.impl.dependencies.DependencyBase |
---|
isInstanceBound, isRequired, setIsInstanceBound, setIsRequired |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.felix.dm.Dependency |
---|
isInstanceBound, isRequired |
Constructor Detail |
---|
public BundleDependencyImpl(BundleContext context, Logger logger)
public BundleDependencyImpl(BundleDependencyImpl prototype)
Method Detail |
---|
public Dependency createCopy()
Dependency
createCopy
in interface Dependency
public BundleDependency setInstanceBound(boolean isInstanceBound)
BundleDependency
init
life cycle method of a component.
setInstanceBound
in interface BundleDependency
isInstanceBound
- true
if this dependency is instance bound
public boolean isAvailable()
Dependency
true
if the dependency is available.
isAvailable
in interface Dependency
true
if the dependency is availablepublic void start(DependencyService service)
start
in interface DependencyActivation
public void stop(DependencyService service)
stop
in interface DependencyActivation
public String getName()
ComponentDependencyDeclaration
getName
in interface ComponentDependencyDeclaration
public int getState()
ComponentDependencyDeclaration
getState
in interface ComponentDependencyDeclaration
public String getType()
ComponentDependencyDeclaration
getType
in interface ComponentDependencyDeclaration
public Object addingBundle(Bundle bundle, BundleEvent event)
BundleTrackerCustomizer
BundleTracker
.
This method is called before a bundle which matched the search parameters
of the BundleTracker
is added to the
BundleTracker
. This method should return the object to be
tracked for the specified Bundle
. The returned object is
stored in the BundleTracker
and is available from the
getObject
method.
addingBundle
in interface BundleTrackerCustomizer
bundle
- The Bundle
being added to the
BundleTracker
.event
- The bundle event which caused this customizer method to be
called or null
if there is no bundle event associated
with the call to this method.
Bundle
object or null
if the specified Bundle
object should not be tracked.public void addedBundle(Bundle bundle, BundleEvent event, Object object)
BundleTrackerCustomizer
addedBundle
in interface BundleTrackerCustomizer
public void modifiedBundle(Bundle bundle, BundleEvent event, Object object)
BundleTrackerCustomizer
BundleTracker
has been modified.
This method is called when a bundle being tracked by the
BundleTracker
has had its state modified.
modifiedBundle
in interface BundleTrackerCustomizer
bundle
- The Bundle
whose state has been modified.event
- The bundle event which caused this customizer method to be
called or null
if there is no bundle event associated
with the call to this method.object
- The tracked object for the specified bundle.public void removedBundle(Bundle bundle, BundleEvent event, Object object)
BundleTrackerCustomizer
BundleTracker
has been removed.
This method is called after a bundle is no longer being tracked by the
BundleTracker
.
removedBundle
in interface BundleTrackerCustomizer
bundle
- The Bundle
that has been removed.event
- The bundle event which caused this customizer method to be
called or null
if there is no bundle event associated
with the call to this method.object
- The tracked object for the specified bundle.public void invokeAdded(DependencyService dependencyService, Bundle service)
public void invokeChanged(DependencyService dependencyService, Bundle service)
public void invokeRemoved(DependencyService dependencyService, Bundle service)
public void invoke(DependencyService dependencyService, Bundle service, String name)
public BundleDependency setCallbacks(String added, String removed)
setCallbacks
in interface BundleDependency
added
- the method to call when a service was addedremoved
- the method to call when a service was removed
public BundleDependency setCallbacks(String added, String changed, String removed)
setCallbacks
in interface BundleDependency
added
- the method to call when a service was addedchanged
- the method to call when a service was changedremoved
- the method to call when a service was removed
public BundleDependency setCallbacks(Object instance, String added, String removed)
setCallbacks
in interface BundleDependency
instance
- the instance to call the callbacks onadded
- the method to call when a service was addedremoved
- the method to call when a service was removed
public BundleDependency setCallbacks(Object instance, String added, String changed, String removed)
setCallbacks
in interface BundleDependency
instance
- the instance to call the callbacks onadded
- the method to call when a service was addedchanged
- the method to call when a service was changedremoved
- the method to call when a service was removed
public BundleDependency setAutoConfig(boolean autoConfig)
BundleDependency
setAutoConfig
in interface BundleDependency
autoConfig
- true
to enable auto configuration
public BundleDependency setAutoConfig(String instanceName)
public BundleDependency setRequired(boolean required)
BundleDependency
setRequired
in interface BundleDependency
required
- true
if this bundle dependency is required
public BundleDependency setBundle(Bundle bundle)
BundleDependency
setBundle
in interface BundleDependency
bundle
- the bundle to depend on
public BundleDependency setFilter(String filter) throws IllegalArgumentException
BundleDependency
setFilter
in interface BundleDependency
filter
- the filter condition
IllegalArgumentException
public BundleDependency setStateMask(int mask)
BundleDependency
setStateMask
in interface BundleDependency
mask
- the mask to use
public boolean isAutoConfig()
Dependency
true>code> if auto configuration is enabled for this dependency.
Auto configuration means that a dependency is injected in the component instance
when it's available, and if it's unavailable, a "null object" will be inserted
instead.
- Specified by:
isAutoConfig
in interface Dependency
- Returns:
true
if auto configuration is enabled for this dependency
public Bundle getBundle()
public Object getAutoConfigInstance()
Dependency
getAutoConfigInstance
in interface Dependency
public Bundle lookupBundle()
public String getAutoConfigName()
Dependency
getAutoConfigName
in interface Dependency
public Class getAutoConfigType()
Dependency
getAutoConfigType
in interface Dependency
public void invokeAdded(DependencyService service)
Dependency
invokeAdded
in interface Dependency
public void invokeRemoved(DependencyService service)
Dependency
invokeRemoved
in interface Dependency
public BundleDependency setPropagate(boolean propagate)
BundleDependency
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).
setPropagate
in interface BundleDependency
propagate
- true
to propagate the bundle manifest properties
public BundleDependency setPropagate(Object instance, String method)
public Dictionary getProperties()
getProperties
in interface Dependency
public boolean isPropagated()
isPropagated
in interface Dependency
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |