Class AsyncItemWriter<T>
java.lang.Object
org.springframework.batch.integration.async.AsyncItemWriter<T>
- All Implemented Interfaces:
org.springframework.batch.infrastructure.item.ItemStream, org.springframework.batch.infrastructure.item.ItemStreamWriter<Future<T>>, org.springframework.batch.infrastructure.item.ItemWriter<Future<T>>
-
Constructor Summary
ConstructorsConstructorDescriptionAsyncItemWriter(org.springframework.batch.infrastructure.item.ItemWriter<T> delegate) Create a new instance ofAsyncItemWriterwith the provided delegate. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidopen(org.springframework.batch.infrastructure.item.ExecutionContext executionContext) voidsetDelegate(org.springframework.batch.infrastructure.item.ItemWriter<T> delegate) voidupdate(org.springframework.batch.infrastructure.item.ExecutionContext executionContext) voidIn the processing of theFutures passed, nulls are not passed to the delegate since they are considered filtered out by theAsyncItemProcessor's delegatedItemProcessor.
-
Constructor Details
-
AsyncItemWriter
Create a new instance ofAsyncItemWriterwith the provided delegate.- Parameters:
delegate- the delegate item writer- Since:
- 6.0
-
-
Method Details
-
setDelegate
- Parameters:
delegate- ItemWriter that does the actual writing of the Future results
-
write
public void write(org.springframework.batch.infrastructure.item.Chunk<? extends Future<T>> items) throws Exception In the processing of theFutures passed, nulls are not passed to the delegate since they are considered filtered out by theAsyncItemProcessor's delegatedItemProcessor. If the unwrapping of theFutureresults in anExecutionException, that will be unwrapped and the cause will be thrown. -
open
public void open(org.springframework.batch.infrastructure.item.ExecutionContext executionContext) throws org.springframework.batch.infrastructure.item.ItemStreamException - Specified by:
openin interfaceorg.springframework.batch.infrastructure.item.ItemStream- Throws:
org.springframework.batch.infrastructure.item.ItemStreamException
-
update
public void update(org.springframework.batch.infrastructure.item.ExecutionContext executionContext) throws org.springframework.batch.infrastructure.item.ItemStreamException - Specified by:
updatein interfaceorg.springframework.batch.infrastructure.item.ItemStream- Throws:
org.springframework.batch.infrastructure.item.ItemStreamException
-
close
public void close() throws org.springframework.batch.infrastructure.item.ItemStreamException- Specified by:
closein interfaceorg.springframework.batch.infrastructure.item.ItemStream- Throws:
org.springframework.batch.infrastructure.item.ItemStreamException
-