class LifecycleManager
extends java.lang.Object
implements org.springframework.beans.factory.DisposableBean
ContextLoaderListener
.| Modifier and Type | Field and Description |
|---|---|
private org.osgi.framework.BundleContext |
bundleContext |
private ApplicationContextConfigurationFactory |
contextConfigurationFactory |
private OsgiApplicationContextCreator |
contextCreator
ApplicationContext Creator
|
private Counter |
contextsStarted
listener counter - used to properly synchronize shutdown
|
private ExtenderConfiguration |
extenderConfiguration |
private static org.apache.commons.logging.Log |
log
logger
|
private java.util.Map<java.lang.Long,ConfigurableOsgiBundleApplicationContext> |
managedContexts
The contexts we are currently managing.
|
private OsgiBundleApplicationContextEventMulticaster |
multicaster |
private java.util.List<OsgiBeanFactoryPostProcessor> |
postProcessors
BFPP list
|
private OsgiContextProcessor |
processor |
private org.springframework.core.task.TaskExecutor |
sameThreadTaskExecutor
Task executor which uses the same thread for running tasks.
|
private org.springframework.core.task.TaskExecutor |
shutdownTaskExecutor
shutdown task executor
|
private org.springframework.core.task.TaskExecutor |
taskExecutor
Task executor used for bootstraping the Spring contexts in async mode
|
private java.util.Timer |
timer |
private TypeCompatibilityChecker |
typeChecker |
private VersionMatcher |
versionMatcher |
| Constructor and Description |
|---|
LifecycleManager(ExtenderConfiguration extenderConfiguration,
VersionMatcher versionMatcher,
ApplicationContextConfigurationFactory appCtxCfgFactory,
OsgiContextProcessor processor,
TypeCompatibilityChecker checker,
org.osgi.framework.BundleContext context) |
| Modifier and Type | Method and Description |
|---|---|
private void |
closeApplicationContext(ConfigurableOsgiBundleApplicationContext ctx)
Closes an application context.
|
void |
destroy() |
ConfigurableOsgiBundleApplicationContext |
getManagedContext(org.osgi.framework.Bundle bundle) |
protected void |
maybeCloseApplicationContextFor(org.osgi.framework.Bundle bundle)
Closing an application context is a potentially long-running activity, however, we *have* to do it synchronously
during the event process as the BundleContext object is not valid once we return from this method.
|
protected void |
maybeCreateApplicationContextFor(org.osgi.framework.Bundle bundle)
Context creation is a potentially long-running activity (certainly more than we want to do on the synchronous
event callback).
|
private void |
stopTaskExecutor()
Do some additional waiting so the service dependency listeners detect the shutdown.
|
private void |
stopTimer()
Cancel any tasks scheduled for the timer.
|
private static final org.apache.commons.logging.Log log
private final java.util.Map<java.lang.Long,ConfigurableOsgiBundleApplicationContext> managedContexts
private Counter contextsStarted
private final java.util.Timer timer
private final org.springframework.core.task.TaskExecutor taskExecutor
private final OsgiApplicationContextCreator contextCreator
private final java.util.List<OsgiBeanFactoryPostProcessor> postProcessors
private final org.springframework.core.task.TaskExecutor shutdownTaskExecutor
private final org.springframework.core.task.TaskExecutor sameThreadTaskExecutor
private final OsgiBundleApplicationContextEventMulticaster multicaster
private final ExtenderConfiguration extenderConfiguration
private final org.osgi.framework.BundleContext bundleContext
private final OsgiContextProcessor processor
private final ApplicationContextConfigurationFactory contextConfigurationFactory
private final VersionMatcher versionMatcher
private final TypeCompatibilityChecker typeChecker
LifecycleManager(ExtenderConfiguration extenderConfiguration, VersionMatcher versionMatcher, ApplicationContextConfigurationFactory appCtxCfgFactory, OsgiContextProcessor processor, TypeCompatibilityChecker checker, org.osgi.framework.BundleContext context)
protected void maybeCreateApplicationContextFor(org.osgi.framework.Bundle bundle)
bundle - protected void maybeCloseApplicationContextFor(org.osgi.framework.Bundle bundle)
bundle - private void closeApplicationContext(ConfigurableOsgiBundleApplicationContext ctx)
ctx - public void destroy()
destroy in interface org.springframework.beans.factory.DisposableBeanpublic ConfigurableOsgiBundleApplicationContext getManagedContext(org.osgi.framework.Bundle bundle)
private void stopTaskExecutor()
private void stopTimer()