|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.core.listener.MulticasterBatchListener
public class MulticasterBatchListener
Constructor Summary | |
---|---|
MulticasterBatchListener()
Initialise the listener instance. |
Method Summary | |
---|---|
void |
afterChunk()
Callback after the chunk is executed, but inside the transaction. |
void |
afterRead(Object item)
Called after ItemReader.read() |
ExitStatus |
afterStep(StepExecution stepExecution)
Give a listener a chance to modify the exit status from a step. |
void |
afterWrite(Object item)
Called after ItemWriter.write(Object) If the item is last in a
chunk, this will be called before any transaction is committed, and
before ChunkListener.afterChunk() |
void |
beforeChunk()
Callback before the chunk is executed, but inside the transaction. |
void |
beforeRead()
Called before ItemReader.read() |
void |
beforeStep(StepExecution stepExecution)
Initialise the state of the listener with the StepExecution from
the current scope. |
void |
beforeWrite(Object item)
Called before ItemWriter.write(Object) |
ExitStatus |
onErrorInStep(StepExecution stepExecution,
Throwable e)
The value returned will be combined with the normal exit status using ExitStatus.and(ExitStatus) . |
void |
onReadError(Exception ex)
Called if an error occurs while trying to write. |
void |
onSkipInRead(Throwable t)
Callback for a failure on read that is legal, so is not going to be re-thrown. |
void |
onSkipInWrite(Object item,
Throwable t)
This item failed on write with the given exception, and a skip was called for. |
void |
onWriteError(Exception ex,
Object item)
Called if an error occurs while trying to write. |
void |
register(StepListener listener)
Register the listener for callbacks on the appropriate interfaces implemented. |
void |
setListeners(StepListener[] listeners)
Register each of the objects as listeners. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MulticasterBatchListener()
Method Detail |
---|
public void setListeners(StepListener[] listeners)
MulticasterBatchListener
broadcast to the individual listeners.
listeners
- an array of listener objects of types known to the
multicaster.public void register(StepListener listener)
StepListener
can be provided, or an
ItemStream
. Other types will be ignored.
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
ExitStatus
to combine with the normal value. Return
null to leave the old value unchanged.CompositeStepExecutionListener.afterStep(StepExecution)
public void beforeStep(StepExecution stepExecution)
StepExecutionListener
StepExecution
from
the current scope.
beforeStep
in interface StepExecutionListener
stepExecution
- CompositeStepExecutionListener.beforeStep(org.springframework.batch.core.StepExecution)
public ExitStatus onErrorInStep(StepExecution stepExecution, Throwable e)
StepExecutionListener
ExitStatus.and(ExitStatus)
.
onErrorInStep
in interface StepExecutionListener
e
-
CompositeStepExecutionListener.onErrorInStep(StepExecution, Throwable)
public void afterChunk()
ChunkListener
afterChunk
in interface ChunkListener
CompositeChunkListener.afterChunk()
public void beforeChunk()
ChunkListener
beforeChunk
in interface ChunkListener
CompositeChunkListener.beforeChunk()
public void afterRead(Object item)
ItemReadListener
ItemReader.read()
afterRead
in interface ItemReadListener
item
- CompositeItemReadListener.afterRead(java.lang.Object)
public void beforeRead()
ItemReadListener
ItemReader.read()
beforeRead
in interface ItemReadListener
CompositeItemReadListener.beforeRead()
public void onReadError(Exception ex)
ItemReadListener
onReadError
in interface ItemReadListener
ex
- CompositeItemReadListener.onReadError(java.lang.Exception)
public void afterWrite(Object item)
ItemWriteListener
ItemWriter.write(Object)
If the item is last in a
chunk, this will be called before any transaction is committed, and
before ChunkListener.afterChunk()
afterWrite
in interface ItemWriteListener
item
- written itemCompositeItemWriteListener.afterWrite(Object)
public void beforeWrite(Object item)
ItemWriteListener
ItemWriter.write(Object)
beforeWrite
in interface ItemWriteListener
item
- CompositeItemWriteListener.beforeWrite(java.lang.Object)
public void onWriteError(Exception ex, Object item)
ItemWriteListener
onWriteError
in interface ItemWriteListener
ex
- item
- CompositeItemWriteListener.onWriteError(java.lang.Exception,
java.lang.Object)
public void onSkipInRead(Throwable t)
SkipListener
onSkipInRead
in interface SkipListener
t
- CompositeSkipListener.onSkipInRead(java.lang.Throwable)
public void onSkipInWrite(Object item, Throwable t)
SkipListener
onSkipInWrite
in interface SkipListener
item
- t
- CompositeSkipListener.onSkipInWrite(java.lang.Object, java.lang.Throwable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |