org.apache.felix.scr.impl.manager
Class ImmediateComponentManager

java.lang.Object
  extended by org.apache.felix.scr.impl.manager.AbstractComponentManager
      extended by org.apache.felix.scr.impl.manager.ImmediateComponentManager
All Implemented Interfaces:
Component
Direct Known Subclasses:
DelayedComponentManager, ServiceFactoryComponentManager

public class ImmediateComponentManager
extends AbstractComponentManager

The default ComponentManager. Objects of this class are responsible for managing implementation object's lifecycle.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.felix.scr.impl.manager.AbstractComponentManager
AbstractComponentManager.Activating, AbstractComponentManager.Active, AbstractComponentManager.Deactivating, AbstractComponentManager.Disabled, AbstractComponentManager.Disabling, AbstractComponentManager.Disposed, AbstractComponentManager.Disposing, AbstractComponentManager.Enabling, AbstractComponentManager.Factory, AbstractComponentManager.FactoryInstance, AbstractComponentManager.Registered, AbstractComponentManager.Satisfied, AbstractComponentManager.State, AbstractComponentManager.Unsatisfied
 
Field Summary
 
Fields inherited from interface org.apache.felix.scr.Component
STATE_ACTIVATING, STATE_ACTIVE, STATE_DEACTIVATING, STATE_DESTROYED, STATE_DISABLED, STATE_DISABLING, STATE_DISPOSED, STATE_DISPOSING, STATE_ENABLED, STATE_ENABLING, STATE_FACTORY, STATE_REGISTERED, STATE_UNSATISFIED
 
Constructor Summary
ImmediateComponentManager(BundleComponentActivator activator, ComponentHolder componentHolder, ComponentMetadata metadata)
          The constructor receives both the activator and the metadata
 
Method Summary
protected  boolean createComponent()
          Method is called by #activate() in STATE_ACTIVATING or by DelayedComponentManager.getService(Bundle, ServiceRegistration) in STATE_REGISTERED.
protected  Object createImplementationObject(ComponentContext componentContext)
           
protected  void deleteComponent(int reason)
           
protected  void disposeImplementationObject(Object implementationObject, ComponentContext componentContext, int reason)
           
 ComponentInstance getComponentInstance()
          Returns the org.osgi.service.component.ComponentInstance representing this component or null if this component is not been activated yet.
 Dictionary getProperties()
          Returns the (private copy) of the Component properties to be used for the ComponentContext as well as eventual service registration.
protected  Object getService()
          Returns the service object to be registered if the service element is specified.
 boolean hasConfiguration()
           
 void reconfigure(Dictionary configuration)
          Called by the Configuration Admin Service to update the component with Configuration properties.
protected  void setFactoryProperties(Dictionary dictionary)
           
 
Methods inherited from class org.apache.felix.scr.impl.manager.AbstractComponentManager
copyTo, copyTo, disable, dispose, enable, getActivate, getActivator, getBundle, getClassName, getComponentMetadata, getConfigurationPolicy, getDeactivate, getFactory, getId, getModified, getName, getReferences, getServiceProperties, getServices, getState, isActivateDeclared, isDeactivateDeclared, isDefaultEnabled, isImmediate, isLogEnabled, isServiceFactory, log, log, registerComponentService, registerService, state, toString, unregisterComponentService, verifyDependencyManagers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImmediateComponentManager

public ImmediateComponentManager(BundleComponentActivator activator,
                                 ComponentHolder componentHolder,
                                 ComponentMetadata metadata)
The constructor receives both the activator and the metadata

Parameters:
activator -
metadata -
Method Detail

createComponent

protected boolean createComponent()
Description copied from class: AbstractComponentManager
Method is called by #activate() in STATE_ACTIVATING or by DelayedComponentManager.getService(Bundle, ServiceRegistration) in STATE_REGISTERED.

Specified by:
createComponent in class AbstractComponentManager
Returns:
true if creation of the component succeeded. If false is returned, the cause should have been logged.

deleteComponent

protected void deleteComponent(int reason)
Specified by:
deleteComponent in class AbstractComponentManager

getComponentInstance

public ComponentInstance getComponentInstance()
Description copied from interface: Component
Returns the org.osgi.service.component.ComponentInstance representing this component or null if this component is not been activated yet.


createImplementationObject

protected Object createImplementationObject(ComponentContext componentContext)

disposeImplementationObject

protected void disposeImplementationObject(Object implementationObject,
                                           ComponentContext componentContext,
                                           int reason)

getService

protected Object getService()
Returns the service object to be registered if the service element is specified.

Extensions of this class may overwrite this method to return a ServiceFactory to register in the case of a delayed or a service factory component.

Specified by:
getService in class AbstractComponentManager
Returns:

setFactoryProperties

protected void setFactoryProperties(Dictionary dictionary)

hasConfiguration

public boolean hasConfiguration()
Specified by:
hasConfiguration in class AbstractComponentManager

getProperties

public Dictionary 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:
getProperties in interface Component
Specified by:
getProperties in class AbstractComponentManager
Returns:
a private Hashtable of component properties

reconfigure

public void reconfigure(Dictionary configuration)
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 the configuration parameter is null. In this case nothing is to be done. If a configuration has previously been set and now the configuration is deleted, the configuration parameter is null and the component has to be reactivated with the default configuration.

Parameters:
configuration - The configuration properties for the component from the Configuration Admin Service or null if there is no configuration or if the configuration has just been deleted.


Copyright © 2011 Apache Software Foundation. All Rights Reserved.