Class ItemWriterAdapter<T>
- java.lang.Object
- org.springframework.batch.item.ItemStreamSupport
- org.springframework.batch.jsr.item.CheckpointSupport
- org.springframework.batch.jsr.item.ItemWriterAdapter<T>
- All Implemented Interfaces:
ItemStream,ItemWriter<T>
public class ItemWriterAdapter<T> extends CheckpointSupport implements ItemWriter<T>
Adapter that wraps anItemWriterfor use by Spring Batch. All calls are delegated as appropriate to the corresponding method on the delegate.- Since:
- 3.0
- Author:
- Michael Minella
Constructor Summary
Constructors Constructor Description ItemWriterAdapter(javax.batch.api.chunk.ItemWriter writer)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.io.SerializabledoCheckpoint()Used to provide aSerializablerepresenting the current state of the batch artifact.protected voiddoClose()Used to close the underlying batch artifactprotected voiddoOpen(java.io.Serializable checkpoint)Used to open a batch artifact with previously saved checkpoint information.voidwrite(java.util.List<? extends T> items)Process the supplied data element.Methods inherited from class org.springframework.batch.jsr.item.CheckpointSupport
close, open, update
Methods inherited from class org.springframework.batch.item.ItemStreamSupport
getExecutionContextKey, setExecutionContextName, setName
Method Detail
write
public void write(java.util.List<? extends T> items) throws java.lang.Exception
Description copied from interface:ItemWriterProcess the supplied data element. Will not be called with any null items in normal operation.- Specified by:
writein interfaceItemWriter<T>- Parameters:
items- items to be written- Throws:
java.lang.Exception- if there are errors. The framework will catch the exception and convert or rethrow it as appropriate.
doOpen
protected void doOpen(java.io.Serializable checkpoint) throws java.lang.ExceptionDescription copied from class:CheckpointSupportUsed to open a batch artifact with previously saved checkpoint information.- Specified by:
doOpenin classCheckpointSupport- Parameters:
checkpoint- previously saved checkpoint object- Throws:
java.lang.Exception- thrown by the implementation
doCheckpoint
protected java.io.Serializable doCheckpoint() throws java.lang.ExceptionDescription copied from class:CheckpointSupportUsed to provide aSerializablerepresenting the current state of the batch artifact.- Specified by:
doCheckpointin classCheckpointSupport- Returns:
- the current state of the batch artifact
- Throws:
java.lang.Exception- thrown by the implementation
doClose
protected void doClose() throws java.lang.ExceptionDescription copied from class:CheckpointSupportUsed to close the underlying batch artifact- Specified by:
doClosein classCheckpointSupport- Throws:
java.lang.Exception- thrown by the underlying implementation