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.
-
-
Constructor Summary
Constructors Constructor Description ChunkLoggingListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterProcess(T item, S result)
void
afterRead(T item)
void
afterWrite(List<? extends S> items)
void
beforeProcess(T item)
void
beforeRead()
void
beforeWrite(List<? extends S> items)
protected String
itemToString(Object item)
void
onProcessError(T item, Exception e)
void
onReadError(Exception e)
void
onSkipInProcess(T item, Throwable t)
void
onSkipInRead(Throwable t)
void
onSkipInWrite(S item, Throwable t)
void
onWriteError(Exception e, List<? extends S> items)
-
-
-
Method Detail
-
itemToString
protected String itemToString(Object item)
- Parameters:
item
- theObject
to format.- Returns:
- the
string representation
.
-
onReadError
public void onReadError(Exception e)
- Specified by:
onReadError
in interfaceorg.springframework.batch.core.ItemReadListener<T>
-
onWriteError
public void onWriteError(Exception e, List<? extends S> items)
- Specified by:
onWriteError
in interfaceorg.springframework.batch.core.ItemWriteListener<T>
-
onSkipInRead
public void onSkipInRead(Throwable t)
-
beforeRead
public void beforeRead()
- Specified by:
beforeRead
in interfaceorg.springframework.batch.core.ItemReadListener<T>
-
afterRead
public void afterRead(T item)
- Specified by:
afterRead
in interfaceorg.springframework.batch.core.ItemReadListener<T>
-
beforeProcess
public void beforeProcess(T item)
-
beforeWrite
public void beforeWrite(List<? extends S> items)
- Specified by:
beforeWrite
in interfaceorg.springframework.batch.core.ItemWriteListener<T>
-
-