Class DefaultItemFailureHandler
java.lang.Object
org.springframework.batch.core.listener.ItemListenerSupport<Object,Object>
org.springframework.batch.core.step.item.DefaultItemFailureHandler
- All Implemented Interfaces:
ItemProcessListener<Object,,Object> ItemReadListener<Object>,ItemWriteListener<Object>,StepListener
Default implementation of the
ItemListenerSupport class that
writes all exceptions via commons logging. Since generics can't be used to
ensure the list contains exceptions, any non exceptions will be logged out by
calling toString on the object.- Author:
- Lucas Ward
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonReadError(Exception ex) Called if an error occurs while trying to read.voidonWriteError(Exception ex, List<? extends Object> 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, waitMethods inherited from interface org.springframework.batch.core.ItemProcessListener
afterProcess, beforeProcess, onProcessErrorMethods inherited from interface org.springframework.batch.core.ItemReadListener
afterRead, beforeReadMethods inherited from interface org.springframework.batch.core.ItemWriteListener
afterWrite, beforeWrite
-
Field Details
-
logger
protected static final org.apache.commons.logging.Log logger
-
-
Constructor Details
-
DefaultItemFailureHandler
public DefaultItemFailureHandler()
-
-
Method Details
-
onReadError
Description copied from interface:ItemReadListenerCalled if an error occurs while trying to read.- Parameters:
ex- thrown fromItemReader
-
onWriteError
Description copied from interface:ItemWriteListenerCalled if an error occurs while trying to write. Will be called inside a transaction, but the transaction will normally be rolled back. There is no way to identify from this callback which of the items (if any) caused the error.- Parameters:
ex- thrown fromItemWriteritem- attempted to be written.
-