|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.core.listener.StepExecutionListenerSupport org.springframework.batch.integration.chunk.ChunkMessageChannelItemWriter
public class ChunkMessageChannelItemWriter
Constructor Summary | |
---|---|
ChunkMessageChannelItemWriter()
|
Method Summary | |
---|---|
ExitStatus |
afterStep(StepExecution stepExecution)
Give a listener a chance to modify the exit status from a step. |
void |
beforeStep(StepExecution stepExecution)
Initialise the state of the listener with the StepExecution from
the current scope. |
void |
clear()
Clear the buffer. |
void |
close(ExecutionContext executionContext)
If any resources are needed for the stream to operate they need to be destroyed here. |
void |
flush()
Flush the buffer, sending the items as a chunk message to be processed by a ChunkHandler . |
void |
open(ExecutionContext executionContext)
Open the stream for the provided ExecutionContext . |
void |
setReplyChannel(org.springframework.integration.channel.MessageChannel replyChannel)
|
void |
setRequestChannel(org.springframework.integration.channel.MessageChannel requestChannel)
|
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(Object item)
Process the supplied data element. |
Methods inherited from class org.springframework.batch.core.listener.StepExecutionListenerSupport |
---|
onErrorInStep |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChunkMessageChannelItemWriter()
Method Detail |
---|
public void setThrottleLimit(long throttleLimit)
throttleLimit
- the throttle limit to setpublic void setReplyChannel(org.springframework.integration.channel.MessageChannel replyChannel)
public void setRequestChannel(org.springframework.integration.channel.MessageChannel requestChannel)
public void write(Object item) throws Exception
ItemWriter
write
in interface ItemWriter
Exception
- if there are errors. If the writer is used inside a
retry or a batch the framework will catch the exception and convert or
rethrow it as appropriate.public void flush() throws FlushFailedException
ChunkHandler
. To avoid overwhelming the receivers, this method
will block until the number of chunks pending is less than the throttle
limit.
flush
in interface ItemWriter
FlushFailedException
- in case of an error. If this exception is
thrown the writer may be in an inconsistent state and manual intervention
might be required to reconcile the data with persistent output.ItemWriter.flush()
public void beforeStep(StepExecution stepExecution)
StepExecutionListener
StepExecution
from
the current scope.
beforeStep
in interface StepExecutionListener
beforeStep
in class StepExecutionListenerSupport
public ExitStatus afterStep(StepExecution stepExecution)
StepExecutionListener
ExitStatus.and(ExitStatus)
.
Called after successful execution of step's processing logic. Throwing
exception in this method will cause step to fail.
afterStep
in interface StepExecutionListener
afterStep
in class StepExecutionListenerSupport
ExitStatus
to combine with the normal value. Return
null to leave the old value unchanged.public void close(ExecutionContext executionContext) throws ItemStreamException
ItemStream
close
in interface ItemStream
executionContext
- the current execution context in case it is needed
ItemStreamException
public void open(ExecutionContext executionContext) throws ItemStreamException
ItemStream
ExecutionContext
.
open
in interface ItemStream
ItemStreamException
public void update(ExecutionContext executionContext) throws ItemStreamException
ItemStream
update
in interface ItemStream
executionContext
- to be updated
ItemStreamException
public void clear() throws ClearFailedException
clear
in interface ItemWriter
ClearFailedException
- in case of an error. If this exception is
thrown the writer may be in an inconsistent state and manual intervention
might be required to reconcile the data with persistent output.ItemWriter.clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |