类 AsyncItemWriter<T>
- java.lang.Object
- org.springframework.batch.integration.async.AsyncItemWriter<T>
- 所有已实现的接口:
ItemStream,ItemStreamWriter<java.util.concurrent.Future<T>>,ItemWriter<java.util.concurrent.Future<T>>,org.springframework.beans.factory.InitializingBean
public class AsyncItemWriter<T> extends java.lang.Object implements ItemStreamWriter<java.util.concurrent.Future<T>>, org.springframework.beans.factory.InitializingBean
构造器概要
构造器 构造器 说明 AsyncItemWriter()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidafterPropertiesSet()voidclose()If any resources are needed for the stream to operate they need to be destroyed here.voidopen(ExecutionContext executionContext)Open the stream for the providedExecutionContext.voidsetDelegate(ItemWriter<T> delegate)voidupdate(ExecutionContext executionContext)Indicates that the execution context provided during open is about to be saved.voidwrite(java.util.List<? extends java.util.concurrent.Future<T>> items)In the processing of theFutures passed, nulls are not passed to the delegate since they are considered filtered out by theAsyncItemProcessor's delegatedItemProcessor.
构造器详细资料
AsyncItemWriter
public AsyncItemWriter()
方法详细资料
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- 指定者:
afterPropertiesSet在接口中org.springframework.beans.factory.InitializingBean- 抛出:
java.lang.Exception
setDelegate
public void setDelegate(ItemWriter<T> delegate)
- 参数:
delegate- ItemWriter that does the actual writing of the Future results
write
public void write(java.util.List<? extends java.util.concurrent.Future<T>> items) throws java.lang.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.- 指定者:
write在接口中ItemWriter<T>- 参数:
items-Futures to be unwrapped and passed to the delegate- 抛出:
java.lang.Exception- The exception returned by the Future if one was thrown
open
public void open(ExecutionContext executionContext) throws ItemStreamException
从接口复制的说明:ItemStreamOpen the stream for the providedExecutionContext.- 指定者:
open在接口中ItemStream- 参数:
executionContext- current step'sExecutionContext. Will be the executionContext from the last run of the step on a restart.- 抛出:
ItemStreamException
update
public void update(ExecutionContext executionContext) throws ItemStreamException
从接口复制的说明:ItemStreamIndicates that the execution context provided during open is about to be saved. If any state is remaining, but has not been put in the context, it should be added here.- 指定者:
update在接口中ItemStream- 参数:
executionContext- to be updated- 抛出:
ItemStreamException
close
public void close() throws ItemStreamException
从接口复制的说明:ItemStreamIf any resources are needed for the stream to operate they need to be destroyed here. Once this method has been called all other methods (except open) may throw an exception.- 指定者:
close在接口中ItemStream- 抛出:
ItemStreamException