Package org.jeasy.batch.core.listener
Class CompositeRecordReaderListener<P>
- java.lang.Object
-
- org.jeasy.batch.core.listener.CompositeRecordReaderListener<P>
-
- Type Parameters:
P
- type of the record's payload
- All Implemented Interfaces:
RecordReaderListener<P>
public class CompositeRecordReaderListener<P> extends java.lang.Object implements RecordReaderListener<P>
Composite listener that delegates processing to other listeners.- Author:
- Mahmoud Ben Hassine ([email protected])
-
-
Constructor Summary
Constructors Constructor Description CompositeRecordReaderListener()
Create a newCompositeRecordReaderListener
.CompositeRecordReaderListener(java.util.List<RecordReaderListener<P>> listeners)
Create a newCompositeRecordReaderListener
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRecordReaderListener(RecordReaderListener<P> recordReaderListener)
Add a delegate listener.void
afterRecordReading(Record<P> record)
Called after each record read operation.void
beforeRecordReading()
Called before each record read operation.void
onRecordReadingException(java.lang.Throwable throwable)
Called when an exception occurs during record reading.
-
-
-
Constructor Detail
-
CompositeRecordReaderListener
public CompositeRecordReaderListener()
Create a newCompositeRecordReaderListener
.
-
CompositeRecordReaderListener
public CompositeRecordReaderListener(java.util.List<RecordReaderListener<P>> listeners)
Create a newCompositeRecordReaderListener
.- Parameters:
listeners
- delegates
-
-
Method Detail
-
beforeRecordReading
public void beforeRecordReading()
Description copied from interface:RecordReaderListener
Called before each record read operation.- Specified by:
beforeRecordReading
in interfaceRecordReaderListener<P>
-
afterRecordReading
public void afterRecordReading(Record<P> record)
Description copied from interface:RecordReaderListener
Called after each record read operation.- Specified by:
afterRecordReading
in interfaceRecordReaderListener<P>
- Parameters:
record
- The record that has been read. May benull
if the reader reached the end of data source
-
onRecordReadingException
public void onRecordReadingException(java.lang.Throwable throwable)
Description copied from interface:RecordReaderListener
Called when an exception occurs during record reading.- Specified by:
onRecordReadingException
in interfaceRecordReaderListener<P>
- Parameters:
throwable
- the throwable that was thrown during record reading
-
addRecordReaderListener
public void addRecordReaderListener(RecordReaderListener<P> recordReaderListener)
Add a delegate listener.- Parameters:
recordReaderListener
- to add
-
-