Example usage for org.springframework.batch.item ExecutionContext remove

List of usage examples for org.springframework.batch.item ExecutionContext remove

Introduction

In this page you can find the example usage for org.springframework.batch.item ExecutionContext remove.

Prototype

@Nullable
public Object remove(String key) 

Source Link

Document

Removes the mapping for a key from this context if it is present.

Usage

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

@Override
public void update(ExecutionContext executionContext) throws ItemStreamException {
    super.update(executionContext);
    if (streamsRegistered) {
        ChunkMonitorData data = getData();
        if (data.offset == 0) {
            // Only call the underlying update method if we are on a chunk
            // boundary
            stream.update(executionContext);
            executionContext.remove(getExecutionContextKey(OFFSET));
        } else {/*from  w  w w  .  j  a v  a  2  s.  c  o  m*/
            executionContext.putInt(getExecutionContextKey(OFFSET), data.offset);
        }
    }
}