public abstract class DefaultLifecycleManager extends Object implements LifecycleManager, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
LifecycleAware
services registered to OSGi and call their LifecycleAware.onStart()
and LifecycleAware.onStop()
when required.
The onStart
method is called when the application is setup according to LifecycleManager.isApplicationSetUp()
, the
plugin is enabled, and the plugin framework has started.
The onStop
method is called if onStart
was called, when plugin and it's dependencies are still present.
This class has concurrency controls for the case of concurrent service registration/deregistration with plugin and application
state activity. It does not account for concurrency of plugin notifications against themselves. This does not happen during
normal usage.Constructor and Description |
---|
DefaultLifecycleManager(com.atlassian.plugin.event.PluginEventManager pluginEventManager,
com.atlassian.plugin.PluginAccessor pluginAccessor,
org.osgi.framework.BundleContext bundleContext) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
destroy() |
protected void |
notifyOnStart()
An override point for subclasses that require callback notification after the initial start of the system.
|
void |
onPluginDisabling(com.atlassian.plugin.event.events.PluginDisablingEvent event) |
void |
onPluginEnabled(com.atlassian.plugin.event.events.PluginEnabledEvent event) |
void |
onPluginFrameworkShuttingDown(com.atlassian.plugin.event.events.PluginFrameworkShuttingDownEvent event) |
void |
onPluginFrameworkStarted(com.atlassian.plugin.event.events.PluginFrameworkStartedEvent event) |
void |
start()
Triggers
LifecycleAware.onStart() on all enabled LifecycleAware components. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isApplicationSetUp
public DefaultLifecycleManager(com.atlassian.plugin.event.PluginEventManager pluginEventManager, com.atlassian.plugin.PluginAccessor pluginAccessor, org.osgi.framework.BundleContext bundleContext)
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void destroy() throws Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
Exception
public void onPluginFrameworkStarted(com.atlassian.plugin.event.events.PluginFrameworkStartedEvent event)
public void onPluginEnabled(com.atlassian.plugin.event.events.PluginEnabledEvent event)
public void onPluginFrameworkShuttingDown(com.atlassian.plugin.event.events.PluginFrameworkShuttingDownEvent event)
public void onPluginDisabling(com.atlassian.plugin.event.events.PluginDisablingEvent event)
public void start()
LifecycleManager
LifecycleAware.onStart()
on all enabled LifecycleAware
components. This method can be called
multiple times but will only start components once and only once the plugin framework has started.start
in interface LifecycleManager
protected void notifyOnStart()
Copyright © 2015 Atlassian. All rights reserved.