Class FlowJob
- java.lang.Object
- org.springframework.batch.core.job.AbstractJob
- org.springframework.batch.core.job.flow.FlowJob
- All Implemented Interfaces:
Job
,StepLocator
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
JsrFlowJob
public class FlowJob extends AbstractJob
Implementation of theJob
interface that allows for complex flows of steps, rather than requiring sequential execution. In general, this job implementation was designed to be used behind a parser, allowing for a namespace to abstract away details.- Since:
- 2.0
- Author:
- Dave Syer
Field Summary
Fields inherited from class org.springframework.batch.core.job.AbstractJob
logger
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doExecute(JobExecution execution)
Extension point for subclasses allowing them to concentrate on processing logic and ignore listeners and repository calls.Step
getStep(java.lang.String stepName)
Retrieve the step with the given name.java.util.Collection<java.lang.String>
getStepNames()
Retrieve the step names.void
setFlow(Flow flow)
Public setter for the flow.Methods inherited from class org.springframework.batch.core.job.AbstractJob
afterPropertiesSet, execute, getDefaultExitStatusForFailure, getJobParametersIncrementer, getJobParametersValidator, getJobRepository, getName, handleStep, isRestartable, registerJobExecutionListener, setBeanName, setJobExecutionListeners, setJobParametersIncrementer, setJobParametersValidator, setJobRepository, setName, setRestartable, toString
Field Detail
flow
protected Flow flow
Method Detail
setFlow
public void setFlow(Flow flow)
Public setter for the flow.- Parameters:
flow
- the flow to set
getStep
public Step getStep(java.lang.String stepName)
Retrieve the step with the given name. If there is no Step with the given name, then return null.- Specified by:
getStep
in interfaceStepLocator
- Specified by:
getStep
in classAbstractJob
- Parameters:
stepName
- name of the step- Returns:
- the Step
getStepNames
public java.util.Collection<java.lang.String> getStepNames()
Retrieve the step names.- Specified by:
getStepNames
in interfaceStepLocator
- Specified by:
getStepNames
in classAbstractJob
- Returns:
- the step names
doExecute
protected void doExecute(JobExecution execution) throws JobExecutionException
Description copied from class:AbstractJob
Extension point for subclasses allowing them to concentrate on processing logic and ignore listeners and repository calls. Implementations usually are concerned with the ordering of steps, and delegate actual step processing toAbstractJob.handleStep(Step, JobExecution)
.- Specified by:
doExecute
in classAbstractJob
- Parameters:
execution
- the currentJobExecution
- Throws:
JobExecutionException
- to signal a fatal batch framework error (not a business or validation exception)- See Also:
AbstractJob.doExecute(JobExecution)