Class AbstractMainDeploymentProcessor
- java.lang.Object
-
- org.craftercms.deployer.impl.processors.AbstractDeploymentProcessor
-
- org.craftercms.deployer.impl.processors.AbstractMainDeploymentProcessor
-
- All Implemented Interfaces:
DeploymentProcessor,InitializableByConfigBean,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware
- Direct Known Subclasses:
AbstractRemoteGitRepoAwareProcessor,AbstractS3Processor,AbstractSearchIndexingProcessor,CloudFrontInvalidationProcessor,CommandLineProcessor,DelayProcessor,FileBasedDeploymentEventProcessor,FindAndReplaceProcessor,GitDiffProcessor,GitUpdateCommitIdProcessor,HttpMethodCallProcessor,ScriptProcessor
public abstract class AbstractMainDeploymentProcessor extends AbstractDeploymentProcessor
Base class forDeploymentProcessors that are executed during the main deployment phase, which is the phase where the change set is retrieved and the files are processed.- Author:
- avasquez
-
-
Field Summary
Fields Modifier and Type Field Description static StringFAIL_DEPLOYMENT_CONFIG_KEYprotected booleanfailDeploymentOnFailure-
Fields inherited from class org.craftercms.deployer.impl.processors.AbstractDeploymentProcessor
alwaysRun, env, excludeFiles, includeFiles, JUMPING_TO_PARAM_NAME, jumpTo, label, name, siteName, targetId
-
-
Constructor Summary
Constructors Constructor Description AbstractMainDeploymentProcessor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ChangeSetdoExecute(Deployment deployment, ChangeSet filteredChangeSet, ChangeSet originalChangeSet)Triggers the execution of the processor for the givenDeploymentandChangeSetprotected abstract ChangeSetdoMainProcess(Deployment deployment, ProcessorExecution execution, ChangeSet filteredChangeSet, ChangeSet originalChangeSet)protected booleanfailDeploymentOnProcessorFailure()Indicates if the deployment should be marked as failed if this processor throws an errorvoidinit(org.apache.commons.configuration2.Configuration config)Initializes the bean using the specified configuration.protected booleanshouldExecute(Deployment deployment, ChangeSet filteredChangeSet)Indicates if the processor should be executed for the givenDeploymentandChangeSet-
Methods inherited from class org.craftercms.deployer.impl.processors.AbstractDeploymentProcessor
destroy, doDestroy, doInit, execute, getFilteredChangeSet, isJumpToActive, isPostDeployment, setBeanName, setEnv, setSiteName, setTargetId, shouldIncludeFile, startJumpTo, supportsMode
-
-
-
-
Field Detail
-
FAIL_DEPLOYMENT_CONFIG_KEY
public static final String FAIL_DEPLOYMENT_CONFIG_KEY
- See Also:
- Constant Field Values
-
failDeploymentOnFailure
protected boolean failDeploymentOnFailure
-
-
Method Detail
-
init
public void init(org.apache.commons.configuration2.Configuration config) throws org.craftercms.commons.config.ConfigurationException, DeployerExceptionInitializes the bean using the specified configuration.- Specified by:
initin interfaceInitializableByConfigBean- Overrides:
initin classAbstractDeploymentProcessor- Parameters:
config- the bean's configuration- Throws:
org.craftercms.commons.config.ConfigurationException- if there's configuration related exceptionDeployerException- if there's a general exception on init
-
doExecute
protected ChangeSet doExecute(Deployment deployment, ChangeSet filteredChangeSet, ChangeSet originalChangeSet) throws Exception
Triggers the execution of the processor for the givenDeploymentandChangeSet- Specified by:
doExecutein classAbstractDeploymentProcessor- Parameters:
deployment- the current deploymentfilteredChangeSet- the filtered change set (as returned byAbstractDeploymentProcessor.getFilteredChangeSet(ChangeSet))originalChangeSet- the original change set (as returned by the previous processors in the pipeline)- Returns:
- a new
ChangeSetor null - Throws:
Exception- if there is any error processing theChangeSet
-
shouldExecute
protected boolean shouldExecute(Deployment deployment, ChangeSet filteredChangeSet)
Indicates if the processor should be executed for the givenDeploymentandChangeSet- Specified by:
shouldExecutein classAbstractDeploymentProcessor- Parameters:
deployment- theDeploymentto checkfilteredChangeSet- theChangeSetto check- Returns:
- true if the processor should be executed
-
doMainProcess
protected abstract ChangeSet doMainProcess(Deployment deployment, ProcessorExecution execution, ChangeSet filteredChangeSet, ChangeSet originalChangeSet) throws DeployerException
Performs the actual work of processing the files in theChangeSet, it is also possible to return a newChangeSetto be used for the following processors in the pipeline- Parameters:
deployment- the current deploymentexecution- the current executionfilteredChangeSet- the filtered change set (as returned byAbstractDeploymentProcessor.getFilteredChangeSet(ChangeSet))originalChangeSet- the original change set (as returned by the previous processors in the pipeline)- Returns:
- a new
ChangeSetor null - Throws:
DeployerException- if there is any error processing theChangeSet
-
failDeploymentOnProcessorFailure
protected boolean failDeploymentOnProcessorFailure()
Indicates if the deployment should be marked as failed if this processor throws an error
-
-