org.springframework.batch.integration.chunk
Class ChunkMessageChannelItemWriter<T>

java.lang.Object
  extended by org.springframework.batch.core.listener.StepExecutionListenerSupport
      extended by 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


Constructor Summary
ChunkMessageChannelItemWriter()
           
 
Method Summary
 ExitStatus afterStep(StepExecution stepExecution)
           
 void beforeStep(StepExecution stepExecution)
           
 void close()
           
 Collection<StepContribution> getStepContributions()
          Get the currently available contributions and drain the source.
 void open(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(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
 

Constructor Detail

ChunkMessageChannelItemWriter

public ChunkMessageChannelItemWriter()
Method Detail

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.