public class ItemWriterAdapter<T> extends CheckpointSupport implements ItemWriter<T>
ItemWriter
for use by Spring Batch. All calls are delegated as appropriate
to the corresponding method on the delegate.Constructor and Description |
---|
ItemWriterAdapter(javax.batch.api.chunk.ItemWriter writer) |
Modifier and Type | Method and Description |
---|---|
protected java.io.Serializable |
doCheckpoint()
Used to provide a
Serializable representing the current state of the
batch artifact. |
protected void |
doClose()
Used to close the underlying batch artifact
|
protected void |
doOpen(java.io.Serializable checkpoint)
Used to open a batch artifact with previously saved checkpoint information.
|
void |
write(java.util.List<? extends T> items)
Process the supplied data element.
|
close, open, update
getExecutionContextKey, setExecutionContextName, setName
public ItemWriterAdapter(javax.batch.api.chunk.ItemWriter writer)
writer
- a ItemWriter
to delegate calls topublic void write(java.util.List<? extends T> items) throws java.lang.Exception
ItemWriter
write
in interface ItemWriter<T>
items
- items to be writtenjava.lang.Exception
- if there are errors. The framework will catch the
exception and convert or rethrow it as appropriate.protected void doOpen(java.io.Serializable checkpoint) throws java.lang.Exception
CheckpointSupport
doOpen
in class CheckpointSupport
checkpoint
- previously saved checkpoint objectjava.lang.Exception
- thrown by the implementationprotected java.io.Serializable doCheckpoint() throws java.lang.Exception
CheckpointSupport
Serializable
representing the current state of the
batch artifact.doCheckpoint
in class CheckpointSupport
java.lang.Exception
- thrown by the implementationprotected void doClose() throws java.lang.Exception
CheckpointSupport
doClose
in class CheckpointSupport
java.lang.Exception
- thrown by the underlying implementation