类 JobStep
- java.lang.Object
- org.springframework.batch.core.step.AbstractStep
- org.springframework.batch.core.step.job.JobStep
- 所有已实现的接口:
Step
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.InitializingBean
public class JobStep extends AbstractStep
AStep
that delegates to aJob
to do its work. This is a great tool for managing dependencies between jobs, and also to modularise complex step logic into something that is testable in isolation. The job is executed with parameters that can be extracted from the step execution, hence this step can also be usefully used as the worker in a parallel or partitioned execution.- 作者:
- Dave Syer
字段概要
从接口继承的字段 org.springframework.batch.core.Step
STEP_TYPE_KEY
构造器概要
构造器 构造器 说明 JobStep()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
protected void
doExecute(StepExecution stepExecution)
Execute the job provided by delegating to theJobLauncher
to prevent duplicate executions.void
setJob(Job job)
TheJob
to delegate to in this step.void
setJobLauncher(JobLauncher jobLauncher)
AJobLauncher
is required to be able to run the enclosedJob
.void
setJobParametersExtractor(JobParametersExtractor jobParametersExtractor)
TheJobParametersExtractor
is used to extractJobParametersExtractor
from theStepExecution
to run theJob
.从类继承的方法 org.springframework.batch.core.step.AbstractStep
close, doExecutionRegistration, doExecutionRelease, execute, getCompositeListener, getJobRepository, getName, getStartLimit, isAllowStartIfComplete, open, registerStepExecutionListener, setAllowStartIfComplete, setBeanName, setJobRepository, setName, setStartLimit, setStepExecutionListeners, toString
构造器详细资料
JobStep
public JobStep()
方法详细资料
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- 指定者:
afterPropertiesSet
在接口中org.springframework.beans.factory.InitializingBean
- 覆盖:
afterPropertiesSet
在类中AbstractStep
- 抛出:
java.lang.Exception
setJobLauncher
public void setJobLauncher(JobLauncher jobLauncher)
AJobLauncher
is required to be able to run the enclosedJob
.- 参数:
jobLauncher
- theJobLauncher
to set
setJobParametersExtractor
public void setJobParametersExtractor(JobParametersExtractor jobParametersExtractor)
TheJobParametersExtractor
is used to extractJobParametersExtractor
from theStepExecution
to run theJob
. By default an instance will be provided that simply copies theJobParameters
from the parent job.- 参数:
jobParametersExtractor
- theJobParametersExtractor
to set
doExecute
protected void doExecute(StepExecution stepExecution) throws java.lang.Exception
Execute the job provided by delegating to theJobLauncher
to prevent duplicate executions. The job parameters will be generated by theJobParametersExtractor
provided (if any), otherwise empty. On a restart, the job parameters will be the same as the last (failed) execution.- 指定者:
doExecute
在类中AbstractStep
- 参数:
stepExecution
- the current step context- 抛出:
java.lang.Exception
- checked exception thrown by implementation- 另请参阅:
AbstractStep.doExecute(StepExecution)