public class Activator extends AbstractExtender implements SimpleLogger
| Modifier and Type | Class and Description |
|---|---|
protected class |
Activator.ScrExtension |
| Modifier and Type | Field and Description |
|---|---|
(package private) static java.lang.String |
LOGSERVICE_CLASS |
private org.osgi.framework.Bundle |
m_bundle |
private ComponentActorThread |
m_componentActor |
private java.util.Map<java.lang.Long,BundleComponentActivator> |
m_componentBundles |
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.util.tracker.ServiceTracker<org.osgi.service.log.LogService,org.osgi.service.log.LogService> |
m_logService |
private org.osgi.framework.ServiceRegistration<?> |
m_runtime_reg |
private ScrCommand |
m_scrCommand |
| Constructor and Description |
|---|
Activator() |
| Modifier and Type | Method and 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.
|
boolean |
isLogEnabled(int level)
Returns
true if logging for the given level is enabled. |
private void |
loadComponents(org.osgi.framework.Bundle bundle)
Loads the components of the given bundle.
|
void |
log(int level,
org.osgi.framework.Bundle bundle,
java.lang.String pattern,
java.lang.Object[] arguments,
java.lang.Throwable ex) |
void |
log(int level,
org.osgi.framework.Bundle bundle,
java.lang.String message,
java.lang.Throwable ex)
Method to actually emit the log message.
|
void |
log(int level,
java.lang.String pattern,
java.lang.Object[] arguments,
java.lang.Throwable ex) |
void |
log(int level,
java.lang.String message,
java.lang.Throwable ex) |
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) |
addingBundle, bundleChanged, chooseBundlesToDestroy, createExecutor, getBundleContext, isStopping, modifiedBundle, removedBundle, startTracking, stopTrackingstatic final java.lang.String LOGSERVICE_CLASS
private ScrConfigurationImpl m_configuration
private org.osgi.framework.BundleContext m_context
private org.osgi.framework.BundleContext m_globalContext
private org.osgi.framework.Bundle m_bundle
private volatile org.osgi.util.tracker.ServiceTracker<org.osgi.service.log.LogService,org.osgi.service.log.LogService> m_logService
private java.util.Map<java.lang.Long,BundleComponentActivator> m_componentBundles
private ComponentRegistry m_componentRegistry
private ComponentActorThread m_componentActor
private org.osgi.framework.ServiceRegistration<?> m_runtime_reg
private ScrCommand m_scrCommand
public void start(org.osgi.framework.BundleContext context)
throws java.lang.Exception
start in interface org.osgi.framework.BundleActivatorstart in class AbstractExtendercontext - The BundleContext of the SCR implementation
bundle.java.lang.Exceptionpublic void restart(boolean globalExtender)
protected void doStart()
throws java.lang.Exception
doStart in class AbstractExtenderjava.lang.Exceptionpublic void stop(org.osgi.framework.BundleContext context)
throws java.lang.Exception
stop in interface org.osgi.framework.BundleActivatorstop in class AbstractExtenderjava.lang.Exceptionpublic void doStop()
throws java.lang.Exception
doStop in class AbstractExtenderjava.lang.Exceptionprotected Activator.ScrExtension doCreateExtension(org.osgi.framework.Bundle bundle) throws java.lang.Exception
AbstractExtenderdoCreateExtension in class AbstractExtenderbundle - the bundle to extendjava.lang.Exception - If something goes wrongprivate void loadComponents(org.osgi.framework.Bundle bundle)
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.
private void disposeComponents(org.osgi.framework.Bundle bundle)
protected void debug(org.osgi.framework.Bundle bundle,
java.lang.String msg)
debug in class AbstractExtenderprotected void warn(org.osgi.framework.Bundle bundle,
java.lang.String msg,
java.lang.Throwable t)
warn in class AbstractExtenderpublic void log(int level,
java.lang.String message,
java.lang.Throwable ex)
log in interface SimpleLoggerpublic void log(int level,
java.lang.String pattern,
java.lang.Object[] arguments,
java.lang.Throwable ex)
log in interface SimpleLoggerpublic void log(int level,
org.osgi.framework.Bundle bundle,
java.lang.String pattern,
java.lang.Object[] arguments,
java.lang.Throwable ex)
public boolean isLogEnabled(int level)
true if logging for the given level is enabled.isLogEnabled in interface SimpleLoggerpublic void log(int level,
org.osgi.framework.Bundle bundle,
java.lang.String message,
java.lang.Throwable ex)
level - The log level to log the message atmessage - The message to logex - An optional Throwable whose stack trace is written,
or null to not log a stack trace.