|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.dm.runtime.ToggleServiceDependency
public class ToggleServiceDependency
This is a custom DependencyManager Dependency, allowing to take control of when the dependency is available or not. It's used in the context of the LifecycleController class, in order to activate/deactivate a Component on demand.
Constructor Summary | |
---|---|
ToggleServiceDependency()
|
|
ToggleServiceDependency(boolean isAvailable)
|
Method Summary | |
---|---|
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. |
|
getAutoConfigType()
Returns the type of the instance that is injected. |
Dictionary |
getProperties()
|
void |
invoke(DependencyService dependencyService,
String name)
|
void |
invokeAdded(DependencyService service)
Invoke the "added" callback on a required dependency. |
void |
invokeRemoved(DependencyService service)
Invoke the "removed" callback on a required dependency. |
boolean |
isAutoConfig()
Returns true>code> if auto configuration is enabled for this dependency. |
boolean |
isAvailable()
Returns true if the dependency is available. |
boolean |
isInstanceBound()
As soon as the instance is created, keep it around, even if this dependency goes away. |
boolean |
isPropagated()
|
boolean |
isRequired()
Returns true if this a required dependency. |
void |
setAvailable(boolean isAvailable)
|
void |
start(DependencyService service)
|
void |
stop(DependencyService service)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ToggleServiceDependency()
public ToggleServiceDependency(boolean isAvailable)
Method Detail |
---|
public void setAvailable(boolean isAvailable)
public Dependency createCopy()
Dependency
createCopy
in interface Dependency
public Object getAutoConfigInstance()
Dependency
getAutoConfigInstance
in interface Dependency
public String getAutoConfigName()
Dependency
getAutoConfigName
in interface Dependency
publicgetAutoConfigType()
Dependency
getAutoConfigType
in interface Dependency
public Dictionary getProperties()
getProperties
in interface Dependency
public void invokeAdded(DependencyService service)
Dependency
invokeAdded
in interface Dependency
public void invokeRemoved(DependencyService service)
Dependency
invokeRemoved
in interface Dependency
public void invoke(DependencyService dependencyService, String name)
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 boolean isAvailable()
Dependency
true
if the dependency is available.
isAvailable
in interface Dependency
true
if the dependency is availablepublic boolean isInstanceBound()
Dependency
isInstanceBound
in interface Dependency
true
if the dependency is instance boundpublic boolean isPropagated()
isPropagated
in interface Dependency
public boolean isRequired()
Dependency
true
if this a required dependency. Required dependencies
are dependencies that must be available before the component can be activated.
isRequired
in interface Dependency
true
if the dependency is requiredpublic void start(DependencyService service)
start
in interface DependencyActivation
public void stop(DependencyService service)
stop
in interface DependencyActivation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |