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
ItemWriter
write
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)
StepExecutionListener
StepExecution
from
the current scope.beforeStep
in interface StepExecutionListener
beforeStep
in class StepExecutionListenerSupport
stepExecution
- instance of StepExecution
.public ExitStatus afterStep(StepExecution stepExecution)
StepExecutionListener
ExitStatus.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 StepExecutionListener
afterStep
in class StepExecutionListenerSupport
stepExecution
- StepExecution
instance.ExitStatus
to combine with the normal value. Return
null
to leave the old value unchanged.public void close() throws ItemStreamException
ItemStream
close
in interface ItemStream
ItemStreamException
public void open(ExecutionContext executionContext) throws ItemStreamException
ItemStream
ExecutionContext
.open
in interface ItemStream
executionContext
- current step's ExecutionContext
. Will be the
executionContext from the last run of the step on a restart.ItemStreamException
public void update(ExecutionContext executionContext) throws ItemStreamException
ItemStream
update
in interface ItemStream
executionContext
- to be updatedItemStreamException
public java.util.Collection<StepContribution> getStepContributions()
StepContributionSource
getStepContributions
in interface StepContributionSource
StepContribution
instances