Class ChunkLoggingListener<T,S>
- java.lang.Object
-
- com.devonfw.module.batch.common.impl.ChunkLoggingListener<T,S>
-
- Type Parameters:
T- type of the items.S- type of the results.
- All Implemented Interfaces:
org.springframework.batch.core.ItemProcessListener<T,S>,org.springframework.batch.core.ItemReadListener<T>,org.springframework.batch.core.ItemWriteListener<S>,org.springframework.batch.core.SkipListener<T,S>,org.springframework.batch.core.StepListener
public class ChunkLoggingListener<T,S> extends Object implements org.springframework.batch.core.SkipListener<T,S>, org.springframework.batch.core.ItemReadListener<T>, org.springframework.batch.core.ItemProcessListener<T,S>, org.springframework.batch.core.ItemWriteListener<S>
Spring Batch listener that logs exceptions together with the item(s) being processed at the time the exceptions occurred.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.LoggerLOG
-
Constructor Summary
Constructors Constructor Description ChunkLoggingListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterProcess(T item, S result)voidafterRead(T item)voidafterWrite(List<? extends S> items)voidbeforeProcess(T item)voidbeforeRead()voidbeforeWrite(List<? extends S> items)protected StringitemToString(Object item)voidonProcessError(T item, Exception e)voidonReadError(Exception e)voidonSkipInProcess(T item, Throwable t)voidonSkipInRead(Throwable t)voidonSkipInWrite(S item, Throwable t)voidonWriteError(Exception e, List<? extends S> items)
-
-
-
Method Detail
-
itemToString
protected String itemToString(Object item)
- Parameters:
item- theObjectto format.- Returns:
- the
string representation.
-
onReadError
public void onReadError(Exception e)
- Specified by:
onReadErrorin interfaceorg.springframework.batch.core.ItemReadListener<T>
-
onWriteError
public void onWriteError(Exception e, List<? extends S> items)
- Specified by:
onWriteErrorin interfaceorg.springframework.batch.core.ItemWriteListener<T>
-
onSkipInRead
public void onSkipInRead(Throwable t)
-
beforeRead
public void beforeRead()
- Specified by:
beforeReadin interfaceorg.springframework.batch.core.ItemReadListener<T>
-
afterRead
public void afterRead(T item)
- Specified by:
afterReadin interfaceorg.springframework.batch.core.ItemReadListener<T>
-
beforeProcess
public void beforeProcess(T item)
-
beforeWrite
public void beforeWrite(List<? extends S> items)
- Specified by:
beforeWritein interfaceorg.springframework.batch.core.ItemWriteListener<T>
-
-