|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.core.listener.StepListenerSupport
public class StepListenerSupport
Basic no-op implementations of all StepListener
implementations.
Constructor Summary | |
---|---|
StepListenerSupport()
|
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 read. |
void |
onWriteError(Exception ex,
Object item)
Called if an error occurs while trying to write. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StepListenerSupport()
Method Detail |
---|
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.public void beforeStep(StepExecution stepExecution)
StepExecutionListener
StepExecution
from
the current scope.
beforeStep
in interface StepExecutionListener
public ExitStatus onErrorInStep(StepExecution stepExecution, Throwable e)
StepExecutionListener
ExitStatus.and(ExitStatus)
.
onErrorInStep
in interface StepExecutionListener
e
- an exception thrown by the step execution
public void afterChunk()
ChunkListener
afterChunk
in interface ChunkListener
public void beforeChunk()
ChunkListener
beforeChunk
in interface ChunkListener
public void afterRead(Object item)
ItemReadListener
ItemReader.read()
afterRead
in interface ItemReadListener
item
- returned from read()public void beforeRead()
ItemReadListener
ItemReader.read()
beforeRead
in interface ItemReadListener
public void onReadError(Exception ex)
ItemReadListener
onReadError
in interface ItemReadListener
ex
- thrown from ItemWriter
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 itempublic void beforeWrite(Object item)
ItemWriteListener
ItemWriter.write(Object)
beforeWrite
in interface ItemWriteListener
item
- to be writtenpublic void onWriteError(Exception ex, Object item)
ItemWriteListener
onWriteError
in interface ItemWriteListener
ex
- thrown from ItemWriter
item
- attempted to be written.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |