类 StagingItemReader<T>
- java.lang.Object
- org.springframework.batch.sample.common.StagingItemReader<T>
- 所有已实现的接口:
StepExecutionListener
,StepListener
,ItemReader<ProcessIndicatorItemWrapper<T>>
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
public class StagingItemReader<T> extends java.lang.Object implements ItemReader<ProcessIndicatorItemWrapper<T>>, StepExecutionListener, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Thread-safe databaseItemReader
implementing the process indicator pattern. To achieve restartability use together withStagingItemProcessor
.
构造器概要
构造器 构造器 说明 StagingItemReader()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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 theStepExecution
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)
构造器详细资料
StagingItemReader
public StagingItemReader()
方法详细资料
setDataSource
public void setDataSource(javax.sql.DataSource dataSource)
destroy
public void destroy() throws java.lang.Exception
- 指定者:
destroy
在接口中org.springframework.beans.factory.DisposableBean
- 抛出:
java.lang.Exception
afterPropertiesSet
public final void afterPropertiesSet() throws java.lang.Exception
- 指定者:
afterPropertiesSet
在接口中org.springframework.beans.factory.InitializingBean
- 抛出:
java.lang.Exception
read
public ProcessIndicatorItemWrapper<T> read()
从接口复制的说明:ItemReader
Reads a piece of input data and advance to the next one. Implementations must returnnull
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
在接口中ItemReader<T>
- 返回:
- T the item to be processed or
null
if the data source is exhausted
afterStep
public ExitStatus afterStep(StepExecution stepExecution)
从接口复制的说明:StepExecutionListener
Give a listener a chance to modify the exit status from a step. The value returned will be combined with the normal exit status usingExitStatus.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
在接口中StepExecutionListener
- 参数:
stepExecution
-StepExecution
instance.- 返回:
- an
ExitStatus
to combine with the normal value. Returnnull
to leave the old value unchanged.
beforeStep
public void beforeStep(StepExecution stepExecution)
从接口复制的说明:StepExecutionListener
Initialize the state of the listener with theStepExecution
from the current scope.- 指定者:
beforeStep
在接口中StepExecutionListener
- 参数:
stepExecution
- instance ofStepExecution
.