org.apache.felix.scr.impl.config
Class ConfigurationComponentRegistry

java.lang.Object
  extended by org.apache.felix.scr.impl.ComponentRegistry
      extended by org.apache.felix.scr.impl.config.ConfigurationComponentRegistry
All Implemented Interfaces:
EventListener, ScrService, ServiceListener, ConfigurationListener

public class ConfigurationComponentRegistry
extends ComponentRegistry
implements ServiceListener, ConfigurationListener


Constructor Summary
ConfigurationComponentRegistry(BundleContext context)
           
 
Method Summary
 void configurationEvent(ConfigurationEvent event)
          Called by the Configuration Admin service if a configuration is updated or removed.
 ComponentHolder createComponentHolder(BundleComponentActivator activator, ComponentMetadata metadata)
          Factory method to issue ComponentHolder instances to manage components described by the given component metadata.
 void dispose()
           
 Configuration[] findFactoryConfigurations(ConfigurationAdmin ca, String factoryPid)
          Returns all configurations whose factory PID equals the given factory PID or null if no such configurations exist
 Configuration findSingletonConfiguration(ConfigurationAdmin ca, String pid)
          Returns the configuration whose PID equals the given pid.
 void serviceChanged(ServiceEvent event)
          Called if the Configuration Admin service changes state.
 
Methods inherited from class org.apache.felix.scr.impl.ComponentRegistry
getComponent, getComponentHolder, getComponents, getComponents, getComponents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationComponentRegistry

public ConfigurationComponentRegistry(BundleContext context)
Method Detail

dispose

public void dispose()
Overrides:
dispose in class ComponentRegistry

createComponentHolder

public ComponentHolder createComponentHolder(BundleComponentActivator activator,
                                             ComponentMetadata metadata)
Description copied from class: ComponentRegistry
Factory method to issue ComponentHolder instances to manage components described by the given component metadata.

Overrides:
createComponentHolder in class ComponentRegistry

serviceChanged

public void serviceChanged(ServiceEvent event)
Called if the Configuration Admin service changes state. This implementation is mainly interested in the Configuration Admin service being registered after the Declarative Services setup to be able to forward existing configuration.

Specified by:
serviceChanged in interface ServiceListener
Parameters:
event - The service change event

configurationEvent

public void configurationEvent(ConfigurationEvent event)
Called by the Configuration Admin service if a configuration is updated or removed.

This method is really only called upon configuration changes; it is not called for existing configurations upon startup of the Configuration Admin service. To bridge this gap, the serviceChanged(ServiceEvent) method called when the Configuration Admin service is registered calls this method for all existing configurations to be able to foward existing configurations to components.

Specified by:
configurationEvent in interface ConfigurationListener
Parameters:
event - The configuration change event

findSingletonConfiguration

public Configuration findSingletonConfiguration(ConfigurationAdmin ca,
                                                String pid)
Returns the configuration whose PID equals the given pid. If no such configuration exists, null is returned.

Parameters:
ctx -
pid -
Returns:

findFactoryConfigurations

public Configuration[] findFactoryConfigurations(ConfigurationAdmin ca,
                                                 String factoryPid)
Returns all configurations whose factory PID equals the given factory PID or null if no such configurations exist

Parameters:
ctx -
factoryPid -
Returns:


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.