public class StagingItemReader<T> extends java.lang.Object implements ItemReader<ProcessIndicatorItemWrapper<T>>, StepExecutionListener, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
ItemReader
implementing the process indicator
pattern.
To achieve restartability use together with StagingItemProcessor
.Constructor and Description |
---|
StagingItemReader() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
ExitStatus |
afterStep(StepExecution stepExecution)
Give a listener a chance to modify the exit status from a step.
|
void |
beforeStep(StepExecution stepExecution)
Initialize the state of the listener with the
StepExecution from
the current scope. |
void |
destroy() |
ProcessIndicatorItemWrapper<T> |
read()
Reads a piece of input data and advance to the next one.
|
void |
setDataSource(javax.sql.DataSource dataSource) |
public void setDataSource(javax.sql.DataSource dataSource)
public void destroy() throws java.lang.Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
java.lang.Exception
public final void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public ProcessIndicatorItemWrapper<T> read()
ItemReader
null
at the end of the input
data set. In a transactional setting, caller might get the same item
twice from successive calls (or otherwise), if the first call was in a
transaction that rolled back.read
in interface ItemReader<ProcessIndicatorItemWrapper<T>>
public ExitStatus afterStep(StepExecution stepExecution)
StepExecutionListener
ExitStatus.and(ExitStatus)
.
Called after execution of step's processing logic (both successful or
failed). Throwing exception in this method has no effect, it will only be
logged.afterStep
in interface StepExecutionListener
ExitStatus
to combine with the normal value. Return
null to leave the old value unchanged.public void beforeStep(StepExecution stepExecution)
StepExecutionListener
StepExecution
from
the current scope.beforeStep
in interface StepExecutionListener