类 CheckpointSupport
- java.lang.Object
- org.springframework.batch.item.ItemStreamSupport
- org.springframework.batch.jsr.item.CheckpointSupport
- 所有已实现的接口:
ItemStream
- 直接已知子类:
ItemReaderAdapter
,ItemWriterAdapter
public abstract class CheckpointSupport extends ItemStreamSupport
Provides support for JSR-352 checkpointing. Checkpoint objects are copied prior to being added to theExecutionContext
for persistence by the framework. If the checkpoint object cannot be copied and further changes occur to the same instance, side effects may occur. In cases like this, it is recommended that a copy of the object being acted upon in the reader/writer is returned via theItemReader.checkpointInfo()
orItemWriter.checkpointInfo()
calls.- 从以下版本开始:
- 3.0
- 作者:
- Michael Minella
构造器概要
构造器 构造器 说明 CheckpointSupport(java.lang.String checkpointKey)
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 void
close()
No-op.protected abstract java.io.Serializable
doCheckpoint()
Used to provide aSerializable
representing the current state of the batch artifact.protected abstract void
doClose()
Used to close the underlying batch artifactprotected abstract void
doOpen(java.io.Serializable checkpoint)
Used to open a batch artifact with previously saved checkpoint information.void
open(ExecutionContext executionContext)
No-op.void
update(ExecutionContext executionContext)
Return emptyExecutionContext
.从类继承的方法 org.springframework.batch.item.ItemStreamSupport
getExecutionContextKey, setExecutionContextName, setName
构造器详细资料
CheckpointSupport
public CheckpointSupport(java.lang.String checkpointKey)
- 参数:
checkpointKey
- key to store the checkpoint object with in theExecutionContext
方法详细资料
open
public void open(ExecutionContext executionContext) throws ItemStreamException
从类复制的说明:ItemStreamSupport
No-op.- 指定者:
open
在接口中ItemStream
- 覆盖:
open
在类中ItemStreamSupport
- 参数:
executionContext
- current step'sExecutionContext
. Will be the executionContext from the last run of the step on a restart.- 抛出:
ItemStreamException
- 另请参阅:
ItemStream.open(ExecutionContext)
doOpen
protected abstract void doOpen(java.io.Serializable checkpoint) throws java.lang.Exception
Used to open a batch artifact with previously saved checkpoint information.- 参数:
checkpoint
- previously saved checkpoint object- 抛出:
java.lang.Exception
- thrown by the implementation
update
public void update(ExecutionContext executionContext) throws ItemStreamException
从类复制的说明:ItemStreamSupport
Return emptyExecutionContext
.- 指定者:
update
在接口中ItemStream
- 覆盖:
update
在类中ItemStreamSupport
- 参数:
executionContext
- to be updated- 抛出:
ItemStreamException
- 另请参阅:
ItemStream.update(ExecutionContext)
doCheckpoint
protected abstract java.io.Serializable doCheckpoint() throws java.lang.Exception
Used to provide aSerializable
representing the current state of the batch artifact.- 返回:
- the current state of the batch artifact
- 抛出:
java.lang.Exception
- thrown by the implementation
close
public void close() throws ItemStreamException
从类复制的说明:ItemStreamSupport
No-op.- 指定者:
close
在接口中ItemStream
- 覆盖:
close
在类中ItemStreamSupport
- 抛出:
ItemStreamException
- 另请参阅:
ItemStream.close()
doClose
protected abstract void doClose() throws java.lang.Exception
Used to close the underlying batch artifact- 抛出:
java.lang.Exception
- thrown by the underlying implementation