|
||||||||||
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.ResourceDependencyImpl
public class ResourceDependencyImpl
Field Summary | |
---|---|
protected List |
m_services
|
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 |
Fields inherited from interface org.apache.felix.dm.ResourceHandler |
---|
FILTER, HOST, PATH, PORT, PROTOCOL, URL |
Constructor Summary | |
---|---|
ResourceDependencyImpl(BundleContext context,
Logger logger)
|
|
ResourceDependencyImpl(ResourceDependencyImpl prototype)
|
Method Summary | |
---|---|
void |
added(URL resource)
Invoked whenever a new resource is added. |
void |
changed(URL resource)
Invoked whenever an existing resource changes. |
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. |
String |
getName()
Returns the name of this dependency. |
Dictionary |
getProperties()
|
URL |
getResource()
|
int |
getState()
Returns the state of this dependency. |
String |
getType()
Returns the name of the type of this dependency. |
void |
invokeAdded(DependencyService service)
Invoke the "added" callback on a required dependency. |
void |
invokeAdded(DependencyService ds,
URL serviceInstance)
|
void |
invokeChanged(DependencyService ds,
URL serviceInstance)
|
void |
invokeRemoved(DependencyService service)
Invoke the "removed" callback on a required dependency. |
void |
invokeRemoved(DependencyService ds,
URL serviceInstance)
|
boolean |
isAutoConfig()
Returns true>code> if auto configuration is enabled for this dependency. |
boolean |
isAvailable()
Returns true if the dependency is available. |
boolean |
isPropagated()
|
void |
removed(URL resource)
Invoked whenever an existing resource is removed. |
ResourceDependency |
setAutoConfig(boolean autoConfig)
Sets auto configuration for this service. |
ResourceDependency |
setAutoConfig(String instanceName)
Sets auto configuration for this service. |
ResourceDependency |
setCallbacks(Object instance,
String added,
String removed)
Sets the callbacks for this service. |
ResourceDependency |
setCallbacks(Object instance,
String added,
String changed,
String removed)
Sets the callbacks for this service. |
ResourceDependency |
setCallbacks(String added,
String removed)
Sets the callbacks for this service. |
ResourceDependency |
setCallbacks(String added,
String changed,
String removed)
Sets the callbacks for this service. |
ResourceDependency |
setFilter(String resourceFilter)
|
ResourceDependency |
setInstanceBound(boolean isInstanceBound)
|
ResourceDependency |
setPropagate(boolean propagate)
|
ResourceDependency |
setPropagate(Object instance,
String method)
|
ResourceDependency |
setRequired(boolean required)
|
ResourceDependency |
setResource(URL resource)
|
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 |
Field Detail |
---|
protected List m_services
Constructor Detail |
---|
public ResourceDependencyImpl(BundleContext context, Logger logger)
public ResourceDependencyImpl(ResourceDependencyImpl prototype)
Method Detail |
---|
public Dependency createCopy()
Dependency
createCopy
in interface Dependency
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 void added(URL resource)
ResourceHandler
added
in interface ResourceHandler
public void changed(URL resource)
ResourceHandler
changed
in interface ResourceHandler
public void removed(URL resource)
ResourceHandler
removed
in interface ResourceHandler
public void invokeAdded(DependencyService ds, URL serviceInstance)
public void invokeChanged(DependencyService ds, URL serviceInstance)
public void invokeRemoved(DependencyService ds, URL serviceInstance)
public ResourceDependency setCallbacks(String added, String removed)
setCallbacks
in interface ResourceDependency
added
- the method to call when a service was addedremoved
- the method to call when a service was removed
public ResourceDependency setCallbacks(String added, String changed, String removed)
setCallbacks
in interface ResourceDependency
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 ResourceDependency setCallbacks(Object instance, String added, String removed)
setCallbacks
in interface ResourceDependency
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 ResourceDependency setCallbacks(Object instance, String added, String changed, String removed)
setCallbacks
in interface ResourceDependency
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 ResourceDependency setAutoConfig(boolean autoConfig)
setAutoConfig
in interface ResourceDependency
autoConfig
- the value of auto config
public ResourceDependency setAutoConfig(String instanceName)
setAutoConfig
in interface ResourceDependency
instanceName
- the name of attribute to auto config
public ResourceDependency setResource(URL resource)
setResource
in interface ResourceDependency
public ResourceDependency setRequired(boolean required)
setRequired
in interface ResourceDependency
public ResourceDependency setFilter(String resourceFilter)
setFilter
in interface ResourceDependency
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 URL getResource()
public Object getAutoConfigInstance()
Dependency
getAutoConfigInstance
in interface Dependency
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 ResourceDependency setPropagate(boolean propagate)
setPropagate
in interface ResourceDependency
public ResourceDependency setPropagate(Object instance, String method)
setPropagate
in interface ResourceDependency
public Dictionary getProperties()
getProperties
in interface Dependency
public boolean isPropagated()
isPropagated
in interface Dependency
public ResourceDependency setInstanceBound(boolean isInstanceBound)
setInstanceBound
in interface ResourceDependency
public String getName()
ComponentDependencyDeclaration
getName
in interface ComponentDependencyDeclaration
public int getState()
ComponentDependencyDeclaration
getState
in interface ComponentDependencyDeclaration
public String getType()
ComponentDependencyDeclaration
getType
in interface ComponentDependencyDeclaration
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |