org.springframework.batch.integration.chunk
Class ChunkMessageChannelItemWriter<T>
java.lang.Object
org.springframework.batch.core.listener.StepExecutionListenerSupport
org.springframework.batch.integration.chunk.ChunkMessageChannelItemWriter<T>
- All Implemented Interfaces:
- StepExecutionListener, StepListener, StepContributionSource, ItemStream, ItemWriter<T>
public class ChunkMessageChannelItemWriter<T>
- extends StepExecutionListenerSupport
- implements ItemWriter<T>, ItemStream, StepContributionSource
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
- Parameters:
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.
- Parameters:
throttleLimit - the throttle limit to set
setMessagingOperations
public void setMessagingOperations(org.springframework.integration.core.MessagingOperations messagingGateway)
setReplyChannel
public void setReplyChannel(org.springframework.integration.core.PollableChannel replyChannel)
write
public void write(List<? extends T> items)
throws Exception
- Specified by:
write in interface ItemWriter<T>
- Throws:
Exception
beforeStep
public void beforeStep(StepExecution stepExecution)
- Specified by:
beforeStep in interface StepExecutionListener- Overrides:
beforeStep in class StepExecutionListenerSupport
afterStep
public ExitStatus afterStep(StepExecution stepExecution)
- Specified by:
afterStep in interface StepExecutionListener- Overrides:
afterStep in class StepExecutionListenerSupport
close
public void close()
throws ItemStreamException
- Specified by:
close in interface ItemStream
- Throws:
ItemStreamException
open
public void open(ExecutionContext executionContext)
throws ItemStreamException
- Specified by:
open in interface ItemStream
- Throws:
ItemStreamException
update
public void update(ExecutionContext executionContext)
throws ItemStreamException
- Specified by:
update in interface ItemStream
- Throws:
ItemStreamException
getStepContributions
public Collection<StepContribution> getStepContributions()
- Description copied from interface:
StepContributionSource
- Get the currently available contributions and drain the source. The next call would return an empty collection,
unless new contributions have arrived.
- Specified by:
getStepContributions in interface StepContributionSource
- Returns:
- a collection of
StepContribution instances
Copyright © 2011. All Rights Reserved.