Class 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 Detail

      • ChunkLoggingListener

        public ChunkLoggingListener()
    • Method Detail

      • onReadError

        public void onReadError​(Exception e)
        Specified by:
        onReadError in interface org.springframework.batch.core.ItemReadListener<T>
      • onProcessError

        public void onProcessError​(T item,
                                   Exception e)
        Specified by:
        onProcessError in interface org.springframework.batch.core.ItemProcessListener<T,​S>
      • onWriteError

        public void onWriteError​(Exception e,
                                 List<? extends S> items)
        Specified by:
        onWriteError in interface org.springframework.batch.core.ItemWriteListener<T>
      • onSkipInRead

        public void onSkipInRead​(Throwable t)
        Specified by:
        onSkipInRead in interface org.springframework.batch.core.SkipListener<T,​S>
      • onSkipInProcess

        public void onSkipInProcess​(T item,
                                    Throwable t)
        Specified by:
        onSkipInProcess in interface org.springframework.batch.core.SkipListener<T,​S>
      • onSkipInWrite

        public void onSkipInWrite​(S item,
                                  Throwable t)
        Specified by:
        onSkipInWrite in interface org.springframework.batch.core.SkipListener<T,​S>
      • beforeRead

        public void beforeRead()
        Specified by:
        beforeRead in interface org.springframework.batch.core.ItemReadListener<T>
      • afterRead

        public void afterRead​(T item)
        Specified by:
        afterRead in interface org.springframework.batch.core.ItemReadListener<T>
      • beforeProcess

        public void beforeProcess​(T item)
        Specified by:
        beforeProcess in interface org.springframework.batch.core.ItemProcessListener<T,​S>
      • afterProcess

        public void afterProcess​(T item,
                                 S result)
        Specified by:
        afterProcess in interface org.springframework.batch.core.ItemProcessListener<T,​S>
      • beforeWrite

        public void beforeWrite​(List<? extends S> items)
        Specified by:
        beforeWrite in interface org.springframework.batch.core.ItemWriteListener<T>
      • afterWrite

        public void afterWrite​(List<? extends S> items)
        Specified by:
        afterWrite in interface org.springframework.batch.core.ItemWriteListener<T>