|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.core.listener.ItemListenerSupport<I,O>
public class ItemListenerSupport<I,O>
Basic no-op implementation of the ItemReadListener
,
ItemProcessListener
, and ItemWriteListener
interfaces. All
are implemented, since it is very common that all may need to be implemented
at once.
Constructor Summary | |
---|---|
ItemListenerSupport()
|
Method Summary | |
---|---|
void |
afterProcess(I item,
O result)
Called after ItemProcessor.process(Object) returns. |
void |
afterRead(I item)
Called after ItemReader.read() |
void |
afterWrite(List<? extends O> item)
Called after ItemWriter.write(java.util.List) This will be
called before any transaction is committed, and before
ChunkListener.afterChunk() |
void |
beforeProcess(I item)
Called before ItemProcessor.process(Object) . |
void |
beforeRead()
Called before ItemReader.read() |
void |
beforeWrite(List<? extends O> item)
Called before ItemWriter.write(java.util.List) |
void |
onProcessError(I item,
Exception e)
Called if an exception was thrown from ItemProcessor.process(Object) . |
void |
onReadError(Exception ex)
Called if an error occurs while trying to read. |
void |
onWriteError(Exception ex,
List<? extends O> 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 ItemListenerSupport()
Method Detail |
---|
public void afterRead(I item)
ItemReadListener
ItemReader.read()
afterRead
in interface ItemReadListener<I>
item
- returned from read()public void beforeRead()
ItemReadListener
ItemReader.read()
beforeRead
in interface ItemReadListener<I>
public void onReadError(Exception ex)
ItemReadListener
onReadError
in interface ItemReadListener<I>
ex
- thrown from ItemWriter
public void afterProcess(I item, O result)
ItemProcessListener
ItemProcessor.process(Object)
returns. If the
processor returns null, this method will still be called, with
a null result, allowing for notification of 'filtered' items.
afterProcess
in interface ItemProcessListener<I,O>
item
- to be processedresult
- of processingpublic void beforeProcess(I item)
ItemProcessListener
ItemProcessor.process(Object)
.
beforeProcess
in interface ItemProcessListener<I,O>
item
- to be processed.public void onProcessError(I item, Exception e)
ItemProcessListener
ItemProcessor.process(Object)
.
onProcessError
in interface ItemProcessListener<I,O>
item
- attempted to be processede
- - exception thrown during processing.public void afterWrite(List<? extends O> item)
ItemWriteListener
ItemWriter.write(java.util.List)
This will be
called before any transaction is committed, and before
ChunkListener.afterChunk()
afterWrite
in interface ItemWriteListener<O>
item
- written itemspublic void beforeWrite(List<? extends O> item)
ItemWriteListener
ItemWriter.write(java.util.List)
beforeWrite
in interface ItemWriteListener<O>
item
- to be writtenpublic void onWriteError(Exception ex, List<? extends O> item)
ItemWriteListener
onWriteError
in interface ItemWriteListener<O>
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 |