Modifier and Type | Method and Description |
---|---|
boolean |
getAutoConfig(java.lang.Class<?> clazz)
Indicates if an object of the given class can be injected in one field of the component
|
java.lang.String |
getAutoConfigInstance(java.lang.Class<?> clazz)
Returns the component instance field that is assignable to a given class type
|
org.osgi.framework.Bundle |
getBundle()
Returns the Compoent's bundle.
|
org.osgi.framework.BundleContext |
getBundleContext()
Returns the Component's bundle context
|
java.util.List<DependencyContext> |
getDependencies()
Returns the list of dependencies that has been registered on this component
|
Event |
getDependencyEvent(DependencyContext dc)
Returns the highest ranked dependency service instance for a given dependency
|
java.util.Set<Event> |
getDependencyEvents(DependencyContext dc)
Returns all the available dependency services for a given dependency
|
java.lang.Object[] |
getInstances()
Returns the component instances
|
Logger |
getLogger()
Returns the logger which can be used by the DependencyManager Dependencies implementations.
|
void |
handleEvent(DependencyContext dc,
EventType type,
Event... event)
Notifies the Component about a dependency event.
|
void |
invokeCallbackMethod(java.lang.Object[] instances,
java.lang.String methodName,
java.lang.Class<?>[][] signatures,
java.lang.Object[][] parameters)
Invoke a component callback method with a given dependency service instance
|
boolean |
isActive()
Is this component already started ?
|
boolean |
isAvailable()
Is this component available (all required dependencies are available) ?
|
void |
setThreadPool(java.util.concurrent.Executor threadPool)
Sets a threadpool that the component will use when handling external events
|
void |
start()
Starts the component.
|
void |
stop()
Stops the component.
|
add, add, getComponentDeclaration, getDependencyManager, getInstance, getServiceProperties, getServiceRegistration, remove, remove, setAutoConfig, setAutoConfig, setCallbacks, setCallbacks, setComposition, setComposition, setDebug, setFactory, setFactory, setImplementation, setInterface, setInterface, setServiceProperties
Logger getLogger()
org.osgi.framework.BundleContext getBundleContext()
org.osgi.framework.Bundle getBundle()
void setThreadPool(java.util.concurrent.Executor threadPool)
threadPool
- a threadpool used to handle component events and invoke the component's lifecycle callbacksvoid start()
void stop()
boolean isActive()
boolean isAvailable()
void handleEvent(DependencyContext dc, EventType type, Event... event)
EventType.ADDED
)
EventType.CHANGED
)
EventType.REMOVED
)
EventType.SWAPPED
)
dc
- the dependencytype
- the dependency event typee
- the dependency eventEventType
java.util.List<DependencyContext> getDependencies()
void invokeCallbackMethod(java.lang.Object[] instances, java.lang.String methodName, java.lang.Class<?>[][] signatures, java.lang.Object[][] parameters)
instances
- the component instancesmethodName
- the method namesignatures
- the method signatures (types)parameters
- the method parametersjava.lang.Object[] getInstances()
getInstances
in interface Component
java.lang.String getAutoConfigInstance(java.lang.Class<?> clazz)
clazz
- the type of an object that has to be injected in the component instance fieldboolean getAutoConfig(java.lang.Class<?> clazz)
clazz
- the class of an object that has to be injected in one of the component fieldsEvent getDependencyEvent(DependencyContext dc)
dc
- the dependencyjava.util.Set<Event> getDependencyEvents(DependencyContext dc)
dc
- the dependency