public class SimpleStepHandler extends Object implements StepHandler, org.springframework.beans.factory.InitializingBean
StepHandler that manages repository and restart
concerns.| Constructor and Description |
|---|
SimpleStepHandler()
Convenient default constructor for configuration usage.
|
SimpleStepHandler(JobRepository jobRepository) |
SimpleStepHandler(JobRepository jobRepository,
ExecutionContext executionContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
Check mandatory properties (jobRepository).
|
StepExecution |
handleStep(Step step,
JobExecution execution)
Handle a step and return the execution for it.
|
void |
setExecutionContext(ExecutionContext executionContext)
A context containing values to be added to the step execution before it
is handled.
|
void |
setJobRepository(JobRepository jobRepository) |
public SimpleStepHandler()
public SimpleStepHandler(JobRepository jobRepository)
jobRepository - public SimpleStepHandler(JobRepository jobRepository, ExecutionContext executionContext)
jobRepository - executionContext - public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionInitializingBean.afterPropertiesSet()public void setJobRepository(JobRepository jobRepository)
jobRepository - the jobRepository to setpublic void setExecutionContext(ExecutionContext executionContext)
executionContext - the execution context to setpublic StepExecution handleStep(Step step, JobExecution execution) throws JobInterruptedException, JobRestartException, StartLimitExceededException
StepHandlerJobExecution, but should manage the persistence of the
StepExecution if required (e.g. at least it needs to be added to
a repository before the step can eb executed).handleStep in interface StepHandlerstep - a Stepexecution - a JobExecutionJobInterruptedException - if there is an interruptionJobRestartException - if there is a problem restarting a failed
stepStartLimitExceededException - if the step exceeds its start limitJob.execute(JobExecution),
Step.execute(StepExecution)Copyright © 2013. All Rights Reserved.