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
- a JobRepository
public SimpleStepHandler(JobRepository jobRepository, ExecutionContext executionContext)
jobRepository
- a JobRepository
executionContext
- the ExecutionContext
for the current Steppublic void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
InitializingBean.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
StepHandler
JobExecution
, 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 StepHandler
step
- a Step
execution
- a JobExecution
JobInterruptedException
- 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 © 2014 Pivotal. All rights reserved.