Class AbstractUpgradeManager<T>
java.lang.Object
org.craftercms.commons.upgrade.impl.AbstractUpgradeManager<T>
- Type Parameters:
T
- The target type supported
- All Implemented Interfaces:
UpgradeManager<T>
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public abstract class AbstractUpgradeManager<T>
extends Object
implements UpgradeManager<T>, org.springframework.context.ApplicationContextAware
Base class for all
UpgradeManager
implementations- Since:
- 3.1.5
- Author:
- joseross
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContext
protected boolean
Indicates if errors during a target upgrade should stop the processprotected org.slf4j.Logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract UpgradeContext
<T> createUpgradeContext
(T target) protected abstract void
doUpgrade
(UpgradeContext<T> context) protected void
executePipeline
(UpgradeContext<T> context, UpgradePipelineFactory<T> pipelineFactory) Returns all targets to be upgradedvoid
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setContinueOnFailure
(boolean continueOnFailure) void
upgrade()
Executes all required upgrades for the systemvoid
Executes all required upgrades for the given target
-
Field Details
-
logger
protected org.slf4j.Logger logger -
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
continueOnFailure
protected boolean continueOnFailureIndicates if errors during a target upgrade should stop the process
-
-
Constructor Details
-
AbstractUpgradeManager
public AbstractUpgradeManager()
-
-
Method Details
-
setContinueOnFailure
public void setContinueOnFailure(boolean continueOnFailure) -
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
upgrade
Description copied from interface:UpgradeManager
Executes all required upgrades for the given target- Specified by:
upgrade
in interfaceUpgradeManager<T>
- Parameters:
target
- the target- Throws:
UpgradeException
- if any of the upgrades fails
-
upgrade
Description copied from interface:UpgradeManager
Executes all required upgrades for the system- Specified by:
upgrade
in interfaceUpgradeManager<T>
- Throws:
UpgradeException
- if any of the upgrades fails
-
getTargets
Description copied from interface:UpgradeManager
Returns all targets to be upgraded- Specified by:
getTargets
in interfaceUpgradeManager<T>
- Returns:
- the list of targets
- Throws:
UpgradeException
- if there is any error finding the targets
-
doGetTargets
- Throws:
Exception
-
createUpgradeContext
-
doUpgrade
- Throws:
Exception
-
executePipeline
protected void executePipeline(UpgradeContext<T> context, UpgradePipelineFactory<T> pipelineFactory) throws ConfigurationException, UpgradeException
-