Class Activator

All Implemented Interfaces:
EventListener, org.osgi.framework.BundleActivator, org.osgi.framework.BundleListener, org.osgi.framework.SynchronousBundleListener, org.osgi.util.tracker.BundleTrackerCustomizer<org.osgi.framework.Bundle>

public class Activator extends AbstractExtender
This activator is used to cover requirement described in section 112.8.1 @@ -27,14 37,202 @@ in active bundles.
  • Field Details

    • m_configuration

      private final ScrConfigurationImpl m_configuration
    • m_context

      private org.osgi.framework.BundleContext m_context
    • m_globalContext

      private org.osgi.framework.BundleContext m_globalContext
    • m_bundle

      private org.osgi.framework.Bundle m_bundle
    • logger

      private volatile ScrLogger logger
    • m_componentBundles

      private Map<Long,BundleComponentActivator> m_componentBundles
    • m_componentRegistry

      private ComponentRegistry m_componentRegistry
    • m_componentActor

      private ComponentActorThread m_componentActor
    • m_runtime_reg

      private org.osgi.framework.ServiceRegistration<org.osgi.service.component.runtime.ServiceComponentRuntime> m_runtime_reg
    • m_componentCommands

      private ComponentCommands m_componentCommands
    • m_componentMetadataStore

      private ConcurrentMap<Long,List<ComponentMetadata>> m_componentMetadataStore
  • Constructor Details

    • Activator

      public Activator()
  • Method Details

    • start

      public void start(org.osgi.framework.BundleContext context) throws Exception
      Registers this instance as a (synchronous) bundle listener and loads the components of already registered bundles.
      Specified by:
      start in interface org.osgi.framework.BundleActivator
      Overrides:
      start in class AbstractExtender
      Parameters:
      context - The BundleContext of the SCR implementation bundle.
      Throws:
      Exception
    • restart

      public void restart(boolean globalExtender)
    • doStart

      protected void doStart() throws Exception
      Overrides:
      doStart in class AbstractExtender
      Throws:
      Exception
    • stop

      public void stop(org.osgi.framework.BundleContext context) throws Exception
      Specified by:
      stop in interface org.osgi.framework.BundleActivator
      Overrides:
      stop in class AbstractExtender
      Throws:
      Exception
    • bundleChanged

      public void bundleChanged(org.osgi.framework.BundleEvent event)
      Specified by:
      bundleChanged in interface org.osgi.framework.BundleListener
      Overrides:
      bundleChanged in class AbstractExtender
    • load

      private static ConcurrentMap<Long,List<ComponentMetadata>> load(org.osgi.framework.BundleContext context, ScrLogger logger, boolean loadFromCache)
    • store

      private static void store(Map<Long,List<ComponentMetadata>> componentsMap, org.osgi.framework.BundleContext context, ScrLogger logger, boolean storeCache)
    • doStop

      public void doStop() throws Exception
      Unregisters this instance as a bundle listener and unloads all components which have been registered during the active life time of the SCR implementation bundle.
      Overrides:
      doStop in class AbstractExtender
      Throws:
      Exception
    • doCreateExtension

      protected Activator.ScrExtension doCreateExtension(org.osgi.framework.Bundle bundle) throws Exception
      Description copied from class: AbstractExtender
      Create the extension for the given bundle, or null if the bundle is not to be extended.
      Specified by:
      doCreateExtension in class AbstractExtender
      Parameters:
      bundle - the bundle to extend
      Returns:
      The extension
      Throws:
      Exception - If something goes wrong
    • loadComponents

      private void loadComponents(org.osgi.framework.Bundle bundle)
      Loads the components of the given bundle. If the bundle has no Service-Component header, this method has no effect. The fragments of a bundle are not checked for the header (112.4.1).

      This method calls the Bundle.getBundleContext() method to find the BundleContext of the bundle. If the context cannot be found, this method does not load components for the bundle.

    • disposeComponents

      private void disposeComponents(org.osgi.framework.Bundle bundle)
      Unloads components of the given bundle. If no components have been loaded for the bundle, this method has no effect.
    • debug

      protected void debug(org.osgi.framework.Bundle bundle, String msg)
      Specified by:
      debug in class AbstractExtender
    • warn

      protected void warn(org.osgi.framework.Bundle bundle, String msg, Throwable t)
      Specified by:
      warn in class AbstractExtender
    • setLogger

      public void setLogger()