Example usage for org.springframework.batch.core.step.item Chunk clearSkips

List of usage examples for org.springframework.batch.core.step.item Chunk clearSkips

Introduction

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

Prototype

public void clearSkips() 

Source Link

Document

Clear only the skips list.

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();/*from w  ww .j a v a 2 s.co  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();

}