public class AsyncItemWriter<T>
extends java.lang.Object
implements org.springframework.batch.item.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() |
void |
open(org.springframework.batch.item.ExecutionContext executionContext) |
void |
setDelegate(org.springframework.batch.item.ItemWriter<T> delegate) |
void |
update(org.springframework.batch.item.ExecutionContext executionContext) |
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(org.springframework.batch.item.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 org.springframework.batch.item.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(org.springframework.batch.item.ExecutionContext executionContext)
throws org.springframework.batch.item.ItemStreamException
open in interface org.springframework.batch.item.ItemStreamorg.springframework.batch.item.ItemStreamExceptionpublic void update(org.springframework.batch.item.ExecutionContext executionContext)
throws org.springframework.batch.item.ItemStreamException
update in interface org.springframework.batch.item.ItemStreamorg.springframework.batch.item.ItemStreamExceptionpublic void close()
throws org.springframework.batch.item.ItemStreamException
close in interface org.springframework.batch.item.ItemStreamorg.springframework.batch.item.ItemStreamException