Example usage for org.springframework.batch.core.scope.context ChunkContext attributeNames

List of usage examples for org.springframework.batch.core.scope.context ChunkContext attributeNames

Introduction

In this page you can find the example usage for org.springframework.batch.core.scope.context ChunkContext attributeNames.

Prototype

@Override
    public String[] attributeNames() 

Source Link

Usage

From source file:org.springframework.xd.dirt.plugins.job.support.listener.SimpleXdChunkListener.java

private ChunkContextInfo convertChunkContext(ChunkContext context) {

    final ChunkContextInfo chunkContextInfo = new ChunkContextInfo();
    chunkContextInfo.setComplete(context.isComplete());
    chunkContextInfo.setStepExecution(context.getStepContext().getStepExecution());

    final String[] attributeNames = context.attributeNames();

    for (String attributeName : attributeNames) {
        final Object attribute = context.getAttribute(attributeName);
        chunkContextInfo.getAttributes().put(attributeName, attribute);
    }//from w ww.  j  a  v a2  s. c  om

    return chunkContextInfo;
}