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:
- org.springframework.batch.core.StepExecutionListener, org.springframework.batch.core.StepListener, StepContributionSource, org.springframework.batch.item.ItemStream, org.springframework.batch.item.ItemWriter<T>
public class ChunkMessageChannelItemWriter<T>
- extends org.springframework.batch.core.listener.StepExecutionListenerSupport
- implements org.springframework.batch.item.ItemWriter<T>, org.springframework.batch.item.ItemStream, StepContributionSource
|
Method Summary |
org.springframework.batch.core.ExitStatus |
afterStep(org.springframework.batch.core.StepExecution stepExecution)
|
void |
beforeStep(org.springframework.batch.core.StepExecution stepExecution)
|
void |
close()
|
Collection<org.springframework.batch.core.StepContribution> |
getStepContributions()
Get the currently available contributions and drain the source. |
void |
open(org.springframework.batch.item.ExecutionContext executionContext)
|
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. |
void |
setMessagingOperations(org.springframework.integration.core.MessagingOperations messagingGateway)
|
void |
setReplyChannel(org.springframework.integration.core.PollableChannel replyChannel)
|
void |
setThrottleLimit(long throttleLimit)
Public setter for the throttle limit. |
void |
update(org.springframework.batch.item.ExecutionContext executionContext)
|
void |
write(List<? extends T> items)
|
| 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 org.springframework.batch.item.ItemWriter<T>
- Throws:
Exception
beforeStep
public void beforeStep(org.springframework.batch.core.StepExecution stepExecution)
- Specified by:
beforeStep in interface org.springframework.batch.core.StepExecutionListener- Overrides:
beforeStep in class org.springframework.batch.core.listener.StepExecutionListenerSupport
afterStep
public org.springframework.batch.core.ExitStatus afterStep(org.springframework.batch.core.StepExecution stepExecution)
- Specified by:
afterStep in interface org.springframework.batch.core.StepExecutionListener- Overrides:
afterStep in class org.springframework.batch.core.listener.StepExecutionListenerSupport
close
public void close()
throws org.springframework.batch.item.ItemStreamException
- Specified by:
close in interface org.springframework.batch.item.ItemStream
- Throws:
org.springframework.batch.item.ItemStreamException
open
public void open(org.springframework.batch.item.ExecutionContext executionContext)
throws org.springframework.batch.item.ItemStreamException
- Specified by:
open in interface org.springframework.batch.item.ItemStream
- Throws:
org.springframework.batch.item.ItemStreamException
update
public void update(org.springframework.batch.item.ExecutionContext executionContext)
throws org.springframework.batch.item.ItemStreamException
- Specified by:
update in interface org.springframework.batch.item.ItemStream
- Throws:
org.springframework.batch.item.ItemStreamException
getStepContributions
public Collection<org.springframework.batch.core.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 © 2013. All Rights Reserved.