Package org.apache.felix.scr.impl
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 ScrLogger
private org.osgi.framework.Bundle
private ComponentActorThread
private Map<Long,
BundleComponentActivator> private ComponentCommands
private ComponentRegistry
private final ScrConfigurationImpl
private org.osgi.framework.BundleContext
private org.osgi.framework.BundleContext
private org.osgi.framework.ServiceRegistration<org.osgi.service.component.runtime.ServiceComponentRuntime>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
private void
disposeComponents
(org.osgi.framework.Bundle bundle) Unloads components of the given bundle.protected Activator.ScrExtension
doCreateExtension
(org.osgi.framework.Bundle bundle) Create the extension for the given bundle, or null if the bundle is not to be extended.protected void
doStart()
void
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.private void
loadComponents
(org.osgi.framework.Bundle bundle) Loads the components of the given bundle.void
restart
(boolean globalExtender) void
start
(org.osgi.framework.BundleContext context) Registers this instance as a (synchronous) bundle listener and loads the components of already registered bundles.void
stop
(org.osgi.framework.BundleContext context) protected void
Methods inherited from class org.apache.felix.scr.impl.AbstractExtender
addingBundle, bundleChanged, 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
-
-
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:
start
in interfaceorg.osgi.framework.BundleActivator
- Overrides:
start
in classAbstractExtender
- Parameters:
context
- TheBundleContext
of the SCR implementation bundle.- Throws:
Exception
-
restart
public void restart(boolean globalExtender) -
doStart
- Overrides:
doStart
in classAbstractExtender
- Throws:
Exception
-
stop
- Specified by:
stop
in interfaceorg.osgi.framework.BundleActivator
- Overrides:
stop
in classAbstractExtender
- Throws:
Exception
-
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:
doStop
in classAbstractExtender
- 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 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 theBundleContext
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
- Specified by:
debug
in classAbstractExtender
-
warn
- Specified by:
warn
in classAbstractExtender
-