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 TypeMethodDescriptionvoid
onReadError
(Exception ex) Called if an error occurs while trying to read.void
onWriteError
(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, wait
Methods inherited from interface org.springframework.batch.core.ItemProcessListener
afterProcess, beforeProcess, onProcessError
Methods inherited from interface org.springframework.batch.core.ItemReadListener
afterRead, beforeRead
Methods 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:ItemReadListener
Called if an error occurs while trying to read.- Parameters:
ex
- thrown fromItemReader
-
onWriteError
Description copied from interface:ItemWriteListener
Called 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 fromItemWriter
item
- attempted to be written.
-