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);
		}

		return chunkContextInfo;
	}
@author Gunnar Hillert
@author Ilayaperumal Gopinathan
@since 1.0
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/plugins/job/support/listener/SimpleXdChunkListener.java