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 (mahmoud.benhassine@icloud.com)
-
-
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 voidaddRecordReaderListener(RecordReaderListener<P> recordReaderListener)Add a delegate listener.voidafterRecordReading(Record<P> record)Called after each record read operation.voidbeforeRecordReading()Called before each record read operation.voidonRecordReadingException(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:RecordReaderListenerCalled before each record read operation.- Specified by:
beforeRecordReadingin interfaceRecordReaderListener<P>
-
afterRecordReading
public void afterRecordReading(Record<P> record)
Description copied from interface:RecordReaderListenerCalled after each record read operation.- Specified by:
afterRecordReadingin interfaceRecordReaderListener<P>- Parameters:
record- The record that has been read. May benullif the reader reached the end of data source
-
onRecordReadingException
public void onRecordReadingException(java.lang.Throwable throwable)
Description copied from interface:RecordReaderListenerCalled when an exception occurs during record reading.- Specified by:
onRecordReadingExceptionin 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
-
-