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:
java.util.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
Activator.ScrExtension
-
Field Summary
Fields Modifier and Type Field Description private ScrLogger
logger
private org.osgi.framework.Bundle
m_bundle
private ComponentActorThread
m_componentActor
private java.util.Map<java.lang.Long,BundleComponentActivator>
m_componentBundles
private ComponentCommands
m_componentCommands
private ComponentRegistry
m_componentRegistry
private ScrConfigurationImpl
m_configuration
private org.osgi.framework.BundleContext
m_context
private org.osgi.framework.BundleContext
m_globalContext
private org.osgi.framework.ServiceRegistration<org.osgi.service.component.runtime.ServiceComponentRuntime>
m_runtime_reg
-
Constructor Summary
Constructors Constructor Description Activator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
debug(org.osgi.framework.Bundle bundle, java.lang.String msg)
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
warn(org.osgi.framework.Bundle bundle, java.lang.String msg, java.lang.Throwable t)
-
Methods inherited from class org.apache.felix.scr.impl.AbstractExtender
addingBundle, bundleChanged, chooseBundlesToDestroy, createExecutor, getBundleContext, isStopping, modifiedBundle, removedBundle, startTracking, stopTracking
-
-
-
-
Field Detail
-
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 java.util.Map<java.lang.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
-
-
Method Detail
-
start
public void start(org.osgi.framework.BundleContext context) throws java.lang.Exception
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:
java.lang.Exception
-
restart
public void restart(boolean globalExtender)
-
doStart
protected void doStart() throws java.lang.Exception
- Overrides:
doStart
in classAbstractExtender
- Throws:
java.lang.Exception
-
stop
public void stop(org.osgi.framework.BundleContext context) throws java.lang.Exception
- Specified by:
stop
in interfaceorg.osgi.framework.BundleActivator
- Overrides:
stop
in classAbstractExtender
- Throws:
java.lang.Exception
-
doStop
public void doStop() throws java.lang.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 classAbstractExtender
- Throws:
java.lang.Exception
-
doCreateExtension
protected Activator.ScrExtension doCreateExtension(org.osgi.framework.Bundle bundle) throws java.lang.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:
java.lang.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
protected void debug(org.osgi.framework.Bundle bundle, java.lang.String msg)
- Specified by:
debug
in classAbstractExtender
-
warn
protected void warn(org.osgi.framework.Bundle bundle, java.lang.String msg, java.lang.Throwable t)
- Specified by:
warn
in classAbstractExtender
-
-