类 SimpleJob
- java.lang.Object
- org.springframework.batch.core.job.AbstractJob
- org.springframework.batch.core.job.SimpleJob
- 所有已实现的接口:
Job
,StepLocator
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.InitializingBean
public class SimpleJob extends AbstractJob
Simple implementation ofJob
interface providing the ability to run aJobExecution
. Sequentially executes a job by iterating through its list of steps. AnyStep
that fails will fail the job. The job is considered complete when all steps have been executed.- 作者:
- Lucas Ward, Dave Syer, Michael Minella
字段概要
从类继承的字段 org.springframework.batch.core.job.AbstractJob
logger
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
addStep(Step step)
Convenience method for adding a single step to the job.protected void
doExecute(JobExecution execution)
Handler of steps sequentially as provided, checking each one for success before moving to the next.Step
getStep(java.lang.String stepName)
Retrieve the step with the given name.java.util.Collection<java.lang.String>
getStepNames()
Convenience method for clients to inspect the steps for this job.void
setSteps(java.util.List<Step> steps)
Public setter for the steps in this job.从类继承的方法 org.springframework.batch.core.job.AbstractJob
afterPropertiesSet, execute, getDefaultExitStatusForFailure, getJobParametersIncrementer, getJobParametersValidator, getJobRepository, getName, handleStep, isRestartable, registerJobExecutionListener, setBeanName, setJobExecutionListeners, setJobParametersIncrementer, setJobParametersValidator, setJobRepository, setName, setRestartable, toString
方法详细资料
setSteps
public void setSteps(java.util.List<Step> steps)
Public setter for the steps in this job. Overrides any calls toaddStep(Step)
.- 参数:
steps
- the steps to execute
getStepNames
public java.util.Collection<java.lang.String> getStepNames()
Convenience method for clients to inspect the steps for this job.- 指定者:
getStepNames
在接口中StepLocator
- 指定者:
getStepNames
在类中AbstractJob
- 返回:
- the step names for this job
addStep
public void addStep(Step step)
Convenience method for adding a single step to the job.- 参数:
step
- aStep
to add
getStep
public Step getStep(java.lang.String stepName)
从类复制的说明:AbstractJob
Retrieve the step with the given name. If there is no Step with the given name, then return null.- 指定者:
getStep
在接口中StepLocator
- 指定者:
getStep
在类中AbstractJob
- 参数:
stepName
- name of the step- 返回:
- the Step
doExecute
protected void doExecute(JobExecution execution) throws JobInterruptedException, JobRestartException, StartLimitExceededException
Handler of steps sequentially as provided, checking each one for success before moving to the next. Returns the lastStepExecution
successfully processed if it exists, and null if none were processed.- 指定者:
doExecute
在类中AbstractJob
- 参数:
execution
- the currentJobExecution
- 抛出:
JobInterruptedException
JobRestartException
StartLimitExceededException
- 另请参阅:
AbstractJob.handleStep(Step, JobExecution)