Class SingleComponentManager<S>
- java.lang.Object
-
- org.apache.felix.scr.impl.manager.AbstractComponentManager<S>
-
- org.apache.felix.scr.impl.manager.SingleComponentManager<S>
-
- All Implemented Interfaces:
SimpleLogger,ComponentManager<S>,org.osgi.framework.ServiceFactory<S>
- Direct Known Subclasses:
ServiceFactoryComponentManager
public class SingleComponentManager<S> extends AbstractComponentManager<S> implements org.osgi.framework.ServiceFactory<S>
The default ComponentManager. Objects of this class are responsible for managing implementation object's lifecycle.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceSingleComponentManager.SetImplementationObject<S>TheSetImplementationObjectinterface provides an API for component managers to setup the implementation object and potentially other parts as part of thecreateImplementationObject(org.osgi.framework.Bundle, org.apache.felix.scr.impl.manager.SingleComponentManager.SetImplementationObject<S>, org.apache.felix.scr.impl.manager.ComponentContextImpl<S>)method processing.-
Nested classes/interfaces inherited from class org.apache.felix.scr.impl.manager.AbstractComponentManager
AbstractComponentManager.State
-
-
Field Summary
-
Fields inherited from class org.apache.felix.scr.impl.manager.AbstractComponentManager
m_activationLock, m_container, m_factoryInstance
-
Fields inherited from interface org.apache.felix.scr.impl.manager.ComponentManager
STATE_ACTIVE, STATE_DISABLED, STATE_DISPOSED, STATE_SATISFIED, STATE_UNSATISFIED_CONFIGURATION, STATE_UNSATISFIED_REFERENCE
-
-
Constructor Summary
Constructors Constructor Description SingleComponentManager(ComponentContainer<S> container, ComponentMethods componentMethods)The constructor receives both the activator and the metadataSingleComponentManager(ComponentContainer<S> container, ComponentMethods componentMethods, boolean factoryInstance)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ScreateImplementationObject(org.osgi.framework.Bundle usingBundle, SingleComponentManager.SetImplementationObject<S> setter, ComponentContextImpl<S> componentContext)protected voiddeleteComponent(int reason)protected voiddisposeImplementationObject(ComponentContextImpl<S> componentContext, int reason)org.osgi.service.component.ComponentInstancegetComponentInstance()voidgetComponentManagers(List<AbstractComponentManager<S>> cms)Map<String,Object>getProperties()Returns the (private copy) of the Component properties to be used for the ComponentContext as well as eventual service registration.SgetService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration<S> serviceRegistration)Dictionary<String,Object>getServiceProperties()Returns the subset of component properties to be used as service properties.protected MethodResultinvokeModifiedMethod()voidreconfigure(Map<String,Object> configuration, boolean configurationDeleted, TargetedPID factoryPid)Called by the Configuration Admin Service to update the component with Configuration properties.protected voidsetFactoryProperties(Dictionary<String,?> dictionary)voidsetServiceProperties(Dictionary<String,?> serviceProperties)voidungetService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration<S> serviceRegistration, S o)-
Methods inherited from class org.apache.felix.scr.impl.manager.AbstractComponentManager
collectDependencies, copyTo, copyToDictionary, copyToMap, disable, dispose, enable, getActivator, getBundle, getComponentMetadata, getId, getName, getProvidedServices, getReferenceManagers, getSpecState, isFactory, isImmediate, isLogEnabled, log, log, registerService, setServiceProperties, toString, unregisterService, verifyDependencyManagers
-
-
-
-
Constructor Detail
-
SingleComponentManager
public SingleComponentManager(ComponentContainer<S> container, ComponentMethods componentMethods)
The constructor receives both the activator and the metadata- Parameters:
componentMethods-
-
SingleComponentManager
public SingleComponentManager(ComponentContainer<S> container, ComponentMethods componentMethods, boolean factoryInstance)
-
-
Method Detail
-
deleteComponent
protected void deleteComponent(int reason)
- Specified by:
deleteComponentin classAbstractComponentManager<S>
-
getComponentInstance
public org.osgi.service.component.ComponentInstance getComponentInstance()
-
createImplementationObject
protected S createImplementationObject(org.osgi.framework.Bundle usingBundle, SingleComponentManager.SetImplementationObject<S> setter, ComponentContextImpl<S> componentContext)
-
disposeImplementationObject
protected void disposeImplementationObject(ComponentContextImpl<S> componentContext, int reason)
-
setFactoryProperties
protected void setFactoryProperties(Dictionary<String,?> dictionary)
-
getProperties
public Map<String,Object> getProperties()
Returns the (private copy) of the Component properties to be used for the ComponentContext as well as eventual service registration. Method implements the Component Properties provisioning as described in 112.6, Component Properties.- Specified by:
getPropertiesin interfaceComponentManager<S>- Specified by:
getPropertiesin classAbstractComponentManager<S>- Returns:
- a private map of component properties
-
setServiceProperties
public void setServiceProperties(Dictionary<String,?> serviceProperties)
- Specified by:
setServicePropertiesin classAbstractComponentManager<S>
-
getServiceProperties
public Dictionary<String,Object> getServiceProperties()
Description copied from class:AbstractComponentManagerReturns the subset of component properties to be used as service properties. These properties are all component properties where property name does not start with dot (.), properties which are considered private.- Overrides:
getServicePropertiesin classAbstractComponentManager<S>
-
reconfigure
public void reconfigure(Map<String,Object> configuration, boolean configurationDeleted, TargetedPID factoryPid)
Called by the Configuration Admin Service to update the component with Configuration properties. This causes the component to be reactivated with the new configuration unless no configuration has ever been set on this component and theconfigurationparameter isnull. In this case nothing is to be done. If a configuration has previously been set and now the configuration is deleted, theconfigurationparameter isnulland the component has to be reactivated with the default configuration.- Specified by:
reconfigurein classAbstractComponentManager<S>- Parameters:
configuration- The configuration properties for the component from the Configuration Admin Service ornullif there is no configuration or if the configuration has just been deleted.configurationDeleted- TODOfactoryPid- TODO
-
invokeModifiedMethod
protected MethodResult invokeModifiedMethod()
-
getService
public S getService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration<S> serviceRegistration)
- Specified by:
getServicein interfaceorg.osgi.framework.ServiceFactory<S>
-
ungetService
public void ungetService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration<S> serviceRegistration, S o)- Specified by:
ungetServicein interfaceorg.osgi.framework.ServiceFactory<S>
-
getComponentManagers
public void getComponentManagers(List<AbstractComponentManager<S>> cms)
- Specified by:
getComponentManagersin classAbstractComponentManager<S>
-
-