SimpleLogger, ComponentManager<S>ComponentFactoryImpl, SingleComponentManagerpublic abstract class AbstractComponentManager<S> extends Object implements SimpleLogger, ComponentManager<S>
| Modifier and Type | Class | Description |
|---|---|---|
protected static class |
AbstractComponentManager.State |
| Modifier and Type | Field | Description |
|---|---|---|
protected ReentrantReadWriteLock |
m_activationLock |
|
protected ComponentContainer<S> |
m_container |
|
protected boolean |
m_factoryInstance |
STATE_ACTIVE, STATE_DISABLED, STATE_DISPOSED, STATE_SATISFIED, STATE_UNSATISFIED_CONFIGURATION, STATE_UNSATISFIED_REFERENCE| Modifier | Constructor | Description |
|---|---|---|
protected |
AbstractComponentManager(ComponentContainer<S> container,
ComponentMethods componentMethods) |
The constructor receives both the activator and the metadata
|
protected |
AbstractComponentManager(ComponentContainer<S> container,
ComponentMethods componentMethods,
boolean factoryInstance) |
| Modifier and Type | Method | Description |
|---|---|---|
protected boolean |
collectDependencies(ComponentContextImpl<S> componentContext) |
Collect and store in m_dependencies_map all the services for dependencies, outside of any locks.
|
protected static Dictionary<String,Object> |
copyTo(Dictionary<String,Object> target,
Map<String,?> source,
boolean allProps) |
Copies the properties from the
source Dictionary
into the target Dictionary except for private
properties (whose name has a leading dot) which are only copied if the
allProps parameter is true. |
protected static Dictionary<String,Object> |
copyToDictionary(Dictionary<String,?> source,
boolean allProps) |
|
protected static Map<String,Object> |
copyToMap(Dictionary<String,?> source,
boolean allProps) |
Copies the properties from the
source Dictionary
into the target Dictionary except for private
properties (whose name has a leading dot) which are only copied if the
allProps parameter is true. |
protected abstract void |
deleteComponent(int reason) |
|
org.osgi.util.promise.Promise<Void> |
disable(boolean async) |
|
void |
dispose(int reason) |
Disposes off this component deactivating and disabling it first as
required.
|
org.osgi.util.promise.Promise<Void> |
enable(boolean async) |
|
ComponentActivator |
getActivator() |
|
org.osgi.framework.Bundle |
getBundle() |
Returns the
Bundle providing this component. |
abstract void |
getComponentManagers(List<AbstractComponentManager<S>> cms) |
|
ComponentMetadata |
getComponentMetadata() |
|
long |
getId() |
|
protected String |
getName() |
|
abstract Map<String,Object> |
getProperties() |
|
protected String[] |
getProvidedServices() |
|
List<? extends ReferenceManager<S,?>> |
getReferenceManagers() |
|
Dictionary<String,Object> |
getServiceProperties() |
Returns the subset of component properties to be used as service
properties.
|
int |
getSpecState() |
|
boolean |
isFactory() |
|
protected boolean |
isImmediate() |
|
boolean |
isLogEnabled(int level) |
Returns
true if logging for the given level is enabled. |
void |
log(int level,
String message,
Object[] arguments,
Throwable ex) |
|
void |
log(int level,
String message,
Throwable ex) |
|
abstract void |
reconfigure(Map<String,Object> configuration,
boolean configurationDeleted,
TargetedPID factoryPid) |
|
protected boolean |
registerService() |
Registers the service on behalf of the component.
|
abstract void |
setServiceProperties(Dictionary<String,?> serviceProperties) |
|
void |
setServiceProperties(MethodResult methodResult,
Integer trackingCount) |
|
String |
toString() |
|
protected boolean |
unregisterService() |
|
protected boolean |
verifyDependencyManagers() |
protected final ComponentContainer<S> m_container
protected final boolean m_factoryInstance
protected final ReentrantReadWriteLock m_activationLock
protected AbstractComponentManager(ComponentContainer<S> container, ComponentMethods componentMethods)
container - componentMethods - protected AbstractComponentManager(ComponentContainer<S> container, ComponentMethods componentMethods, boolean factoryInstance)
public final org.osgi.util.promise.Promise<Void> enable(boolean async)
public final org.osgi.util.promise.Promise<Void> disable(boolean async)
public void dispose(int reason)
This method unlike the other state change methods immediately takes action and disposes the component. The reason for this is, that this method has to actually complete before other actions like bundle stopping may continue.
public long getId()
getId in interface ComponentManager<S>protected String getName()
public org.osgi.framework.Bundle getBundle()
Bundle providing this component. If the
component as already been disposed off, this method returns
null.protected boolean isImmediate()
public boolean isFactory()
protected abstract void deleteComponent(int reason)
protected String[] getProvidedServices()
protected boolean registerService()
protected boolean unregisterService()
protected boolean collectDependencies(ComponentContextImpl<S> componentContext)
componentContext - possible instance key for prototype scope referencespublic ComponentActivator getActivator()
public boolean isLogEnabled(int level)
true if logging for the given level is enabled.isLogEnabled in interface SimpleLoggerpublic void log(int level,
String message,
Throwable ex)
log in interface SimpleLoggerpublic void log(int level,
String message,
Object[] arguments,
Throwable ex)
log in interface SimpleLoggerprotected boolean verifyDependencyManagers()
public List<? extends ReferenceManager<S,?>> getReferenceManagers()
getReferenceManagers in interface ComponentManager<S>public abstract Map<String,Object> getProperties()
getProperties in interface ComponentManager<S>public abstract void setServiceProperties(Dictionary<String,?> serviceProperties)
public Dictionary<String,Object> getServiceProperties()
protected static Dictionary<String,Object> copyTo(Dictionary<String,Object> target, Map<String,?> source, boolean allProps)
source Dictionary
into the target Dictionary except for private
properties (whose name has a leading dot) which are only copied if the
allProps parameter is true.target - The Dictionary into which to copy the
properties. If null a new Hashtable is
created.source - The Dictionary providing the properties to
copy. If null or empty, nothing is copied.allProps - Whether all properties (true) or only the
public properties (false) are to be copied.target is returned, which may be empty if
source is null or empty and
target was null or all properties are
private and had not to be copiedprotected static Map<String,Object> copyToMap(Dictionary<String,?> source, boolean allProps)
source Dictionary
into the target Dictionary except for private
properties (whose name has a leading dot) which are only copied if the
allProps parameter is true.source - The Dictionary providing the properties to
copy. If null or empty, nothing is copied.allProps - Whether all properties (true) or only the
public properties (false) are to be copied.target is returned, which may be empty if
source is null or empty and
target was null or all properties are
private and had not to be copiedprotected static Dictionary<String,Object> copyToDictionary(Dictionary<String,?> source, boolean allProps)
public ComponentMetadata getComponentMetadata()
public int getSpecState()
getSpecState in interface ComponentManager<S>public void setServiceProperties(MethodResult methodResult, Integer trackingCount)
public abstract void reconfigure(Map<String,Object> configuration, boolean configurationDeleted, TargetedPID factoryPid)
public abstract void getComponentManagers(List<AbstractComponentManager<S>> cms)
Copyright © 2006–2019 The Apache Software Foundation. All rights reserved.