public abstract class CheckpointSupport extends ItemStreamSupport
ExecutionContext
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 the
ItemReader.checkpointInfo()
or ItemWriter.checkpointInfo()
calls.Constructor and Description |
---|
CheckpointSupport(java.lang.String checkpointKey) |
Modifier and Type | Method and Description |
---|---|
void |
close()
No-op.
|
protected abstract java.io.Serializable |
doCheckpoint()
Used to provide a
Serializable representing the current state of the
batch artifact. |
protected abstract void |
doClose()
Used to close the underlying batch artifact
|
protected 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 empty
ExecutionContext . |
getExecutionContextKey, setExecutionContextName, setName
public CheckpointSupport(java.lang.String checkpointKey)
checkpointKey
- key to store the checkpoint object with in the ExecutionContext
public void open(ExecutionContext executionContext) throws ItemStreamException
ItemStreamSupport
open
in interface ItemStream
open
in class ItemStreamSupport
executionContext
- current step's ExecutionContext
. Will be the
executionContext from the last run of the step on a restart.ItemStreamException
ItemStream.open(ExecutionContext)
protected abstract void doOpen(java.io.Serializable checkpoint) throws java.lang.Exception
checkpoint
- previously saved checkpoint objectjava.lang.Exception
- thrown by the implementationpublic void update(ExecutionContext executionContext) throws ItemStreamException
ItemStreamSupport
ExecutionContext
.update
in interface ItemStream
update
in class ItemStreamSupport
executionContext
- to be updatedItemStreamException
ItemStream.update(ExecutionContext)
protected abstract java.io.Serializable doCheckpoint() throws java.lang.Exception
Serializable
representing the current state of the
batch artifact.java.lang.Exception
- thrown by the implementationpublic void close() throws ItemStreamException
ItemStreamSupport
close
in interface ItemStream
close
in class ItemStreamSupport
ItemStreamException
ItemStream.close()
protected abstract void doClose() throws java.lang.Exception
java.lang.Exception
- thrown by the underlying implementation