public class DefaultPluginUpgradeManager extends Object implements PluginUpgradeManager, LifecycleAware, org.springframework.beans.factory.InitializingBean
Upgrades are triggered by the start lifecycle event, and plugin enabled.
| Modifier and Type | Field and Description |
|---|---|
protected static String |
LOCK_TIMEOUT_PROPERTY |
protected static int |
LOCK_TIMEOUT_SECONDS |
| Constructor and Description |
|---|
DefaultPluginUpgradeManager(List<PluginUpgradeTask> upgradeTasks,
TransactionTemplate transactionTemplate,
com.atlassian.plugin.PluginAccessor pluginAccessor,
PluginSettingsFactory pluginSettingsFactory,
com.atlassian.plugin.event.PluginEventManager pluginEventManager,
com.atlassian.beehive.ClusterLockService clusterLockService) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected Map<String,List<PluginUpgradeTask>> |
getUpgradeTasks() |
void |
onBind(PluginUpgradeTask task,
Map props)
Deprecated.
as of 2.0.16 no longer used we now use the eventing framework to run upgrade tasks for plugins that
are 'enabled', see
onPluginEnabled(com.atlassian.plugin.event.events.PluginEnabledEvent) |
void |
onPluginEnabled(com.atlassian.plugin.event.events.PluginEnabledEvent event) |
void |
onStart()
Notification that the plugin is enabled and the application is started, including after being restored from backup.
|
void |
onStop()
Notification that the plugin is going to be stopped.
|
List<Message> |
upgrade()
Finds and upgrades all plugins, that implement PluginUpgradeTask
|
List<Message> |
upgradeInternal() |
List<Message> |
upgradeInternal(com.atlassian.plugin.Plugin plugin) |
protected static final String LOCK_TIMEOUT_PROPERTY
protected static final int LOCK_TIMEOUT_SECONDS
public DefaultPluginUpgradeManager(List<PluginUpgradeTask> upgradeTasks, TransactionTemplate transactionTemplate, com.atlassian.plugin.PluginAccessor pluginAccessor, PluginSettingsFactory pluginSettingsFactory, com.atlassian.plugin.event.PluginEventManager pluginEventManager, com.atlassian.beehive.ClusterLockService clusterLockService)
@Deprecated public void onBind(PluginUpgradeTask task, Map props)
onPluginEnabled(com.atlassian.plugin.event.events.PluginEnabledEvent)This method does nothing but logging at the moment. Is is now deprecated since it could result in circular dependency when trying to bind already exposed update tasks to plugin manager that is being created.
task - the upgrade task that is being boundprops - the set of properties that the upgrade task was registered withpublic void onStart()
LifecycleAwareonStart in interface LifecycleAwarepublic void onStop()
LifecycleAware
Will be invoked if previously notified with LifecycleAware.onStart(), before the plugin is disabled or framework is
shut down.
onStop in interface LifecycleAwarepublic void onPluginEnabled(com.atlassian.plugin.event.events.PluginEnabledEvent event)
protected Map<String,List<PluginUpgradeTask>> getUpgradeTasks()
public List<Message> upgrade()
PluginUpgradeManagerupgrade in interface PluginUpgradeManagerCopyright © 2019 Atlassian. All rights reserved.