|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.batch.core.step.AbstractStep
public abstract class AbstractStep
A Step implementation that provides common behavior to subclasses,
including registering and calling listeners.
| Constructor Summary | |
|---|---|
AbstractStep()
Default constructor. |
|
AbstractStep(String name)
Convenient constructor for setting only the name property. |
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
protected void |
close(ExecutionContext ctx)
Extension point for subclasses to provide callbacks to their collaborators at the end of a step (right at the end of the finally block), to close or release resources. |
protected abstract void |
doExecute(StepExecution stepExecution)
Extension point for subclasses to execute business logic. |
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 void |
open(ExecutionContext ctx)
Extension point for subclasses to provide callbacks to their collaborators at the beginning of a step, to open or acquire resources. |
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 flag that determines whether the step should start again if it is already complete. |
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. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractStep()
public AbstractStep(String name)
name - | Method Detail |
|---|
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic String getName()
getName in interface Steppublic void setName(String name)
setBeanName(java.lang.String)public void setBeanName(String name)
setBeanName in interface BeanNameAwareBeanNameAware.setBeanName(java.lang.String)public int getStartLimit()
getStartLimit in interface Steppublic void setStartLimit(int startLimit)
startLimit - the startLimit to setpublic boolean isAllowStartIfComplete()
isAllowStartIfComplete in interface Steppublic void setAllowStartIfComplete(boolean allowStartIfComplete)
allowStartIfComplete - the value of the flag to set
protected abstract void doExecute(StepExecution stepExecution)
throws Exception
ExitStatus on the StepExecution before
returning.
stepExecution - the current step context
Exception
protected void open(ExecutionContext ctx)
throws Exception
ctx - the ExecutionContext to use
Exception
protected void close(ExecutionContext ctx)
throws Exception
ctx - the ExecutionContext to use
Exception
public final void execute(StepExecution stepExecution)
throws JobInterruptedException,
UnexpectedJobExecutionException
open(ExecutionContext)), execution
logic (doExecute(StepExecution)) and resource closing (
close(ExecutionContext)).
execute in interface StepstepExecution - an entity representing the step to be executed
JobInterruptedException - if the step is interrupted externally
UnexpectedJobExecutionExceptionpublic void registerStepExecutionListener(StepExecutionListener listener)
listener - a StepExecutionListenerpublic 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()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||