|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.core.step.AbstractStep
public abstract class AbstractStep
A Step
implementation that provides common behavior to subclasses,
including registering and calling listeners.
Nested Class Summary | |
---|---|
protected static class |
AbstractStep.FatalException
Signals a fatal exception - e.g. |
Field Summary | |
---|---|
static String |
JOB_INTERRUPTED
Exit code for interrupted status. |
Constructor Summary | |
---|---|
AbstractStep()
Default constructor. |
|
AbstractStep(String name)
Convenient constructor for setting only the name property. |
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
protected abstract void |
close(ExecutionContext ctx)
|
protected abstract ExitStatus |
doExecute(StepExecution stepExecution)
|
void |
execute(StepExecution stepExecution)
Template method for step execution logic - calls abstract methods for resource initialization ( open(ExecutionContext) ), execution
logic (doExecute(StepExecution) ) and resource closing (close(ExecutionContext) ). |
protected StepExecutionListener |
getCompositeListener()
|
protected JobRepository |
getJobRepository()
|
String |
getName()
|
int |
getStartLimit()
|
boolean |
isAllowStartIfComplete()
|
protected abstract void |
open(ExecutionContext ctx)
|
void |
registerStepExecutionListener(StepExecutionListener listener)
Register a step listener for callbacks at the appropriate stages in a step execution. |
void |
setAllowStartIfComplete(boolean allowStartIfComplete)
Public setter for the shouldAllowStartIfComplete. |
void |
setBeanName(String name)
Set the name property if it is not already set. |
void |
setJobRepository(JobRepository jobRepository)
Public setter for JobRepository . |
void |
setName(String name)
Set the name property. |
void |
setStartLimit(int startLimit)
Public setter for the startLimit. |
void |
setStepExecutionListeners(StepExecutionListener[] listeners)
Register each of the objects as listeners. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String JOB_INTERRUPTED
Constructor Detail |
---|
public AbstractStep()
public AbstractStep(String name)
name
- Method Detail |
---|
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
public String getName()
getName
in interface Step
public void setName(String name)
setBeanName(java.lang.String)
public void setBeanName(String name)
setBeanName
in interface BeanNameAware
BeanNameAware.setBeanName(java.lang.String)
public int getStartLimit()
getStartLimit
in interface Step
public void setStartLimit(int startLimit)
startLimit
- the startLimit to setpublic boolean isAllowStartIfComplete()
isAllowStartIfComplete
in interface Step
public void setAllowStartIfComplete(boolean allowStartIfComplete)
allowStartIfComplete
- the shouldAllowStartIfComplete to setprotected abstract ExitStatus doExecute(StepExecution stepExecution) throws Exception
Exception
protected abstract void open(ExecutionContext ctx) throws Exception
Exception
protected abstract void close(ExecutionContext ctx) throws Exception
Exception
public final void execute(StepExecution stepExecution) throws JobInterruptedException, UnexpectedJobExecutionException
open(ExecutionContext)
), execution
logic (doExecute(StepExecution)
) and resource closing (close(ExecutionContext)
).
execute
in interface Step
stepExecution
- an entity representing the step to be executed
JobInterruptedException
- if the step is interrupted externally
UnexpectedJobExecutionException
public void registerStepExecutionListener(StepExecutionListener listener)
listener
- a StepExecutionListener
public void setStepExecutionListeners(StepExecutionListener[] listeners)
listeners
- an array of listener objects of known types.protected StepExecutionListener getCompositeListener()
public void setJobRepository(JobRepository jobRepository)
JobRepository
.
jobRepository
- is a mandatory dependence (no default).protected JobRepository getJobRepository()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |