Class AbstractItemProcessListener

  • All Implemented Interfaces:
    ItemProcessListener


    public abstract class AbstractItemProcessListener
    extends java.lang.Object
    implements ItemProcessListener
    The AbstractItemProcessListener provides default implementations of less commonly implemented methods.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterProcess​(java.lang.Object item, java.lang.Object result)
      Override this method if the ItemProcessListener will do something after the item is processed.
      void beforeProcess​(java.lang.Object item)
      Override this method if the ItemProcessListener will do something before the item is processed.
      void onProcessError​(java.lang.Object item, java.lang.Exception ex)
      Override this method if the ItemProcessListener will do something when the ItemProcessor processItem method throws an exception.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractItemProcessListener

        public AbstractItemProcessListener​()
    • Method Detail

      • beforeProcess

        public void beforeProcess​(java.lang.Object item)
                           throws java.lang.Exception
        Override this method if the ItemProcessListener will do something before the item is processed. The default implementation does nothing.
        Specified by:
        beforeProcess in interface ItemProcessListener
        Parameters:
        item - specifies the item about to be processed.
        Throws:
        java.lang.Exception - (or subclass) if an error occurs.
      • afterProcess

        public void afterProcess​(java.lang.Object item,
                                 java.lang.Object result)
                          throws java.lang.Exception
        Override this method if the ItemProcessListener will do something after the item is processed. The default implementation does nothing.
        Specified by:
        afterProcess in interface ItemProcessListener
        Parameters:
        item - specifies the item about to be processed.
        result - specifies the item to pass to the item writer.
        Throws:
        java.lang.Exception - (or subclass) if an error occurs.
      • onProcessError

        public void onProcessError​(java.lang.Object item,
                                   java.lang.Exception ex)
                            throws java.lang.Exception
        Override this method if the ItemProcessListener will do something when the ItemProcessor processItem method throws an exception. The default implementation does nothing.
        Specified by:
        onProcessError in interface ItemProcessListener
        Parameters:
        item - specifies the item about to be processed.
        ex - specifies the exception thrown by the item processor.
        Throws:
        java.lang.Exception - (or subclass) if an error occurs.