Example usage for org.springframework.batch.core.step.item SkipWrapper getException

List of usage examples for org.springframework.batch.core.step.item SkipWrapper getException

Introduction

In this page you can find the example usage for org.springframework.batch.core.step.item SkipWrapper getException.

Prototype

@Nullable
public Throwable getException() 

Source Link

Document

Public getter for the exception.

Usage

From source file:org.springframework.batch.core.step.item.FaultTolerantChunkProcessor.java

private void callSkipListeners(final Chunk<I> inputs, final Chunk<O> outputs) {

    for (SkipWrapper<I> wrapper : inputs.getSkips()) {
        I item = wrapper.getItem();/*ww  w . j a  va  2s . c  o m*/
        if (item == null) {
            continue;
        }
        Throwable e = wrapper.getException();
        callProcessSkipListener(item, e);
    }

    for (SkipWrapper<O> wrapper : outputs.getSkips()) {
        Throwable e = wrapper.getException();
        try {
            getListener().onSkipInWrite(wrapper.getItem(), e);
        } catch (RuntimeException ex) {
            throw new SkipListenerFailedException("Fatal exception in SkipListener.", ex, e);
        }
    }

    // Clear skips if we are possibly going to process this chunk again
    outputs.clearSkips();
    inputs.clearSkips();

}