public class AsyncItemWriter<T> extends java.lang.Object implements ItemStreamWriter<java.util.concurrent.Future<T>>, org.springframework.beans.factory.InitializingBean
| Constructor and Description |
|---|
AsyncItemWriter() |
| 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 |
setDelegate(ItemWriter<T> delegate) |
void |
update(ExecutionContext executionContext)
Indicates that the execution context provided during open is about to be saved.
|
void |
write(java.util.List<? extends java.util.concurrent.Future<T>> items)
In the processing of the
Futures passed, nulls are not passed to the
delegate since they are considered filtered out by the AsyncItemProcessor's
delegated ItemProcessor. |
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic void setDelegate(ItemWriter<T> delegate)
delegate - ItemWriter that does the actual writing of the Future resultspublic void write(java.util.List<? extends java.util.concurrent.Future<T>> items) throws java.lang.Exception
Futures passed, nulls are not passed to the
delegate since they are considered filtered out by the AsyncItemProcessor's
delegated ItemProcessor. If the unwrapping
of the Future results in an ExecutionException, that will be
unwrapped and the cause will be thrown.write in interface ItemWriter<java.util.concurrent.Future<T>>items - Futures to be unwrapped and passed to the delegatejava.lang.Exception - The exception returned by the Future if one was thrownpublic void open(ExecutionContext executionContext) throws ItemStreamException
ItemStreamExecutionContext.open in interface ItemStreamexecutionContext - current step's ExecutionContext. Will be the
executionContext from the last run of the step on a restart.ItemStreamExceptionpublic void update(ExecutionContext executionContext) throws ItemStreamException
ItemStreamupdate in interface ItemStreamexecutionContext - to be updatedItemStreamExceptionpublic void close()
throws ItemStreamException
ItemStreamclose in interface ItemStreamItemStreamException