Class Activator
java.lang.Object
org.apache.felix.scr.impl.AbstractExtender
org.apache.felix.scr.impl.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>
This activator is used to cover requirement described in section 112.8.1 @@ -27,14
37,202 @@ in active bundles.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ScrLoggerprivate org.osgi.framework.Bundleprivate ComponentActorThreadprivate Map<Long, BundleComponentActivator> private ComponentCommandsprivate ConcurrentMap<Long, List<ComponentMetadata>> private ComponentRegistryprivate final ScrConfigurationImplprivate org.osgi.framework.BundleContextprivate org.osgi.framework.BundleContextprivate org.osgi.framework.ServiceRegistration<org.osgi.service.component.runtime.ServiceComponentRuntime> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbundleChanged(org.osgi.framework.BundleEvent event) protected voidprivate voiddisposeComponents(org.osgi.framework.Bundle bundle) Unloads components of the given bundle.protected Activator.ScrExtensiondoCreateExtension(org.osgi.framework.Bundle bundle) Create the extension for the given bundle, or null if the bundle is not to be extended.protected voiddoStart()voiddoStop()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.private static ConcurrentMap<Long, List<ComponentMetadata>> private voidloadComponents(org.osgi.framework.Bundle bundle) Loads the components of the given bundle.voidrestart(boolean globalExtender) voidvoidstart(org.osgi.framework.BundleContext context) Registers this instance as a (synchronous) bundle listener and loads the components of already registered bundles.voidstop(org.osgi.framework.BundleContext context) private static voidstore(Map<Long, List<ComponentMetadata>> componentsMap, org.osgi.framework.BundleContext context, ScrLogger logger, boolean storeCache) protected voidMethods inherited from class AbstractExtender
addingBundle, chooseBundlesToDestroy, createExecutor, getBundleContext, isStopping, modifiedBundle, removedBundle, startTracking, stopTracking
-
Field Details
-
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
-
m_componentBundles
-
m_componentRegistry
-
m_componentActor
-
m_runtime_reg
private org.osgi.framework.ServiceRegistration<org.osgi.service.component.runtime.ServiceComponentRuntime> m_runtime_reg -
m_componentCommands
-
m_componentMetadataStore
-
-
Constructor Details
-
Activator
public Activator()
-
-
Method Details
-
start
Registers this instance as a (synchronous) bundle listener and loads the components of already registered bundles.- Specified by:
startin interfaceorg.osgi.framework.BundleActivator- Overrides:
startin classAbstractExtender- Parameters:
context- TheBundleContextof the SCR implementation bundle.- Throws:
Exception
-
restart
public void restart(boolean globalExtender) -
doStart
- Overrides:
doStartin classAbstractExtender- Throws:
Exception
-
stop
- Specified by:
stopin interfaceorg.osgi.framework.BundleActivator- Overrides:
stopin classAbstractExtender- Throws:
Exception
-
bundleChanged
public void bundleChanged(org.osgi.framework.BundleEvent event) - Specified by:
bundleChangedin interfaceorg.osgi.framework.BundleListener- Overrides:
bundleChangedin classAbstractExtender
-
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
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:
doStopin classAbstractExtender- Throws:
Exception
-
doCreateExtension
protected Activator.ScrExtension doCreateExtension(org.osgi.framework.Bundle bundle) throws Exception Description copied from class:AbstractExtenderCreate the extension for the given bundle, or null if the bundle is not to be extended.- Specified by:
doCreateExtensionin classAbstractExtender- 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 theBundleContextof 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
- Specified by:
debugin classAbstractExtender
-
warn
- Specified by:
warnin classAbstractExtender
-
setLogger
public void setLogger()
-