public class ChunkMessageChannelItemWriter<T> extends StepExecutionListenerSupport implements ItemWriter<T>, ItemStream, StepContributionSource
| Constructor and Description |
|---|
ChunkMessageChannelItemWriter() |
| Modifier and Type | Method and Description |
|---|---|
ExitStatus |
afterStep(StepExecution stepExecution)
Give a listener a chance to modify the exit status from a step.
|
void |
beforeStep(StepExecution stepExecution)
Initialize the state of the listener with the
StepExecution from
the current scope. |
void |
close()
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.
|
void |
open(ExecutionContext executionContext)
Open the stream for the provided
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.MessagingTemplate messagingGateway) |
void |
setReplyChannel(org.springframework.messaging.PollableChannel replyChannel) |
void |
setThrottleLimit(long throttleLimit)
Public setter for the throttle limit.
|
void |
update(ExecutionContext executionContext)
Indicates that the execution context provided during open is about to be saved.
|
void |
write(java.util.List<? extends T> items)
Process the supplied data element.
|
public void setMaxWaitTimeouts(int maxWaitTimeouts)
maxWaitTimeouts - the maximum number of wait timeoutspublic void setThrottleLimit(long throttleLimit)
throttleLimit - the throttle limit to setpublic void setMessagingOperations(org.springframework.integration.core.MessagingTemplate messagingGateway)
public void setReplyChannel(org.springframework.messaging.PollableChannel replyChannel)
public void write(java.util.List<? extends T> items) throws java.lang.Exception
ItemWriterwrite in interface ItemWriter<T>items - items to be writtenjava.lang.Exception - if there are errors. The framework will catch the
exception and convert or rethrow it as appropriate.public void beforeStep(StepExecution stepExecution)
StepExecutionListenerStepExecution from
the current scope.beforeStep in interface StepExecutionListenerbeforeStep in class StepExecutionListenerSupportstepExecution - instance of StepExecution.@Nullable public ExitStatus afterStep(StepExecution stepExecution)
StepExecutionListenerExitStatus.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 in interface StepExecutionListenerafterStep in class StepExecutionListenerSupportstepExecution - StepExecution instance.ExitStatus to combine with the normal value. Return
null to leave the old value unchanged.public void close()
throws ItemStreamException
ItemStreamclose in interface ItemStreamItemStreamExceptionpublic void open(ExecutionContext executionContext) throws ItemStreamException
ItemStreamExecutionContext.open in interface ItemStreamexecutionContext - current step's ExecutionContext. Will be the
executionContext from the last run of the step on a restart.ItemStreamExceptionpublic void update(ExecutionContext executionContext) throws ItemStreamException
ItemStreamupdate in interface ItemStreamexecutionContext - to be updatedItemStreamExceptionpublic java.util.Collection<StepContribution> getStepContributions()
StepContributionSourcegetStepContributions in interface StepContributionSourceStepContribution instances