类 ChunkMessageChannelItemWriter<T>
- java.lang.Object
- org.springframework.batch.core.listener.StepExecutionListenerSupport
- org.springframework.batch.integration.chunk.ChunkMessageChannelItemWriter<T>
- 所有已实现的接口:
StepExecutionListener,StepListener,StepContributionSource,ItemStream,ItemWriter<T>
public class ChunkMessageChannelItemWriter<T> extends StepExecutionListenerSupport implements ItemWriter<T>, ItemStream, StepContributionSource
构造器概要
构造器 构造器 说明 ChunkMessageChannelItemWriter()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 ExitStatusafterStep(StepExecution stepExecution)Give a listener a chance to modify the exit status from a step.voidbeforeStep(StepExecution stepExecution)Initialize the state of the listener with theStepExecutionfrom the current scope.voidclose()If any resources are needed for the stream to operate they need to be destroyed here.java.util.Collection<StepContribution>getStepContributions()Get the currently available contributions and drain the source.voidopen(ExecutionContext executionContext)Open the stream for the providedExecutionContext.voidsetMaxWaitTimeouts(int maxWaitTimeouts)The maximum number of times to wait at the end of a step for a non-null result from the remote workers.voidsetMessagingOperations(org.springframework.integration.core.MessagingTemplate messagingGateway)voidsetReplyChannel(org.springframework.messaging.PollableChannel replyChannel)voidsetThrottleLimit(long throttleLimit)Public setter for the throttle limit.voidupdate(ExecutionContext executionContext)Indicates that the execution context provided during open is about to be saved.voidwrite(java.util.List<? extends T> items)Process the supplied data element.
构造器详细资料
ChunkMessageChannelItemWriter
public ChunkMessageChannelItemWriter()
方法详细资料
setMaxWaitTimeouts
public void setMaxWaitTimeouts(int maxWaitTimeouts)
The maximum number of times to wait at the end of a step for a non-null result from the remote workers. This is a multiplier on the receive timeout set separately on the gateway. The ideal value is a compromise between allowing slow workers time to finish, and responsiveness if there is a dead worker. Defaults to 40.- 参数:
maxWaitTimeouts- the maximum number of wait timeouts
setThrottleLimit
public void setThrottleLimit(long throttleLimit)
Public setter for the throttle limit. This limits the number of pending requests for chunk processing to avoid overwhelming the receivers.- 参数:
throttleLimit- the throttle limit to set
setMessagingOperations
public void setMessagingOperations(org.springframework.integration.core.MessagingTemplate messagingGateway)
setReplyChannel
public void setReplyChannel(org.springframework.messaging.PollableChannel replyChannel)
write
public void write(java.util.List<? extends T> items) throws java.lang.Exception
从接口复制的说明:ItemWriterProcess the supplied data element. Will not be called with any null items in normal operation.- 指定者:
write在接口中ItemWriter<T>- 参数:
items- items to be written- 抛出:
java.lang.Exception- if there are errors. The framework will catch the exception and convert or rethrow it as appropriate.
beforeStep
public void beforeStep(StepExecution stepExecution)
从接口复制的说明:StepExecutionListenerInitialize the state of the listener with theStepExecutionfrom the current scope.- 指定者:
beforeStep在接口中StepExecutionListener- 覆盖:
beforeStep在类中StepExecutionListenerSupport- 参数:
stepExecution- instance ofStepExecution.
afterStep
public ExitStatus afterStep(StepExecution stepExecution)
从接口复制的说明:StepExecutionListenerGive a listener a chance to modify the exit status from a step. The value returned will be combined with the normal exit status usingExitStatus.and(ExitStatus). Called after execution of step's processing logic (both successful or failed). Throwing exception in this method has no effect, it will only be logged.- 指定者:
afterStep在接口中StepExecutionListener- 覆盖:
afterStep在类中StepExecutionListenerSupport- 参数:
stepExecution-StepExecutioninstance.- 返回:
- an
ExitStatusto combine with the normal value. Returnnullto leave the old value unchanged.
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
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
getStepContributions
public java.util.Collection<StepContribution> getStepContributions()
从接口复制的说明:StepContributionSourceGet the currently available contributions and drain the source. The next call would return an empty collection, unless new contributions have arrived.- 指定者:
getStepContributions在接口中StepContributionSource- 返回:
- a collection of
StepContributioninstances