|
||||||||||
| 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.
| Nested Class Summary | |
|---|---|
protected static class |
AbstractStep.FatalException
Signals a fatal exception - e.g. |
| Constructor Summary | |
|---|---|
AbstractStep()
Default constructor. |
|
AbstractStep(java.lang.String name)
Convenient constructor for setting only the name property. |
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
protected void |
close(org.springframework.batch.item.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()
|
java.lang.String |
getName()
|
int |
getStartLimit()
|
boolean |
isAllowStartIfComplete()
|
protected void |
open(org.springframework.batch.item.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(java.lang.String name)
Set the name property if it is not already set. |
void |
setJobRepository(JobRepository jobRepository)
Public setter for JobRepository. |
void |
setName(java.lang.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. |
java.lang.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(java.lang.String name)
name - | Method Detail |
|---|
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic java.lang.String getName()
getName in interface Steppublic void setName(java.lang.String name)
setBeanName(java.lang.String)public void setBeanName(java.lang.String name)
setBeanName in interface org.springframework.beans.factory.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 java.lang.Exception
ExitStatus on the StepExecution before
returning.
stepExecution - the current step context
AbstractStep.FatalException
java.lang.Exception
protected void open(org.springframework.batch.item.ExecutionContext ctx)
throws java.lang.Exception
ctx - the ExecutionContext to use
AbstractStep.FatalException
java.lang.Exception
protected void close(org.springframework.batch.item.ExecutionContext ctx)
throws java.lang.Exception
ctx - the ExecutionContext to use
AbstractStep.FatalException
java.lang.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 java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||