public class CompositeItemWriter<T> extends java.lang.Object implements ItemStreamWriter<T>, org.springframework.beans.factory.InitializingBean
ItemWriter
s in fixed-order sequence.Constructor and Description |
---|
CompositeItemWriter() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
close()
If any resources are needed for the stream to operate they need to be destroyed here.
|
void |
open(ExecutionContext executionContext)
Open the stream for the provided
ExecutionContext . |
void |
setDelegates(java.util.List<ItemWriter<? super T>> delegates)
The list of item writers to use as delegates.
|
void |
setIgnoreItemStream(boolean ignoreItemStream)
Establishes the policy whether to call the open, close, or update methods for the
item writer delegates associated with the CompositeItemWriter.
|
void |
update(ExecutionContext executionContext)
Indicates that the execution context provided during open is about to be saved.
|
void |
write(java.util.List<? extends T> item)
Process the supplied data element.
|
public void setIgnoreItemStream(boolean ignoreItemStream)
ignoreItemStream
- if false the delegates' open, close, or update methods will
be called when the corresponding methods on the CompositeItemWriter are called. If
true the delegates' open, close, nor update methods will not be called (default is false).public void write(java.util.List<? extends T> item) throws java.lang.Exception
ItemWriter
write
in interface ItemWriter<T>
item
- items to be writtenjava.lang.Exception
- if there are errors. The framework will catch the
exception and convert or rethrow it as appropriate.public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public void setDelegates(java.util.List<ItemWriter<? super T>> delegates)
delegates
- the list of delegates to use. The delegates list must not be null nor be empty.public void close() throws ItemStreamException
ItemStream
close
in interface ItemStream
ItemStreamException
public void open(ExecutionContext executionContext) throws ItemStreamException
ItemStream
ExecutionContext
.open
in interface ItemStream
executionContext
- current step's ExecutionContext
. Will be the
executionContext from the last run of the step on a restart.ItemStreamException
public void update(ExecutionContext executionContext) throws ItemStreamException
ItemStream
update
in interface ItemStream
executionContext
- to be updatedItemStreamException