From d54166e60759565ec86ac1319bcd0ab6277300bd Mon Sep 17 00:00:00 2001 From: lucasward Date: Thu, 14 Feb 2008 05:45:13 +0000 Subject: [PATCH] BATCH-220:Further refinements to chunk processing. The chunker/dechunker interfaces now accept a StepExecution, so that they don't have to be instantiated anew for each chunk. They can also be wired into the ChunkedStep as well. --- .../batch/core/domain/Dechunker.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/domain/Dechunker.java b/spring-batch-core/src/main/java/org/springframework/batch/core/domain/Dechunker.java index 60655b6e4..b03fc865f 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/domain/Dechunker.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/domain/Dechunker.java @@ -25,9 +25,20 @@ import org.springframework.batch.item.ItemReader; * {@link Chunk} and adds it to an outgoing stream of items. * * @author Lucas Ward - * */ public interface Dechunker { - DechunkingResult dechunk(Chunk chunk) throws Exception; + /** + * Dechunk the provided chunk. In general, this will be done by delegating to an + * {@link ItemWriter} for each item in the {@link Chunk}, however, it's purely at the + * discretion of various implementations. + * + * @param chunk to be 'dechunked' + * @param stepExecution the chunk belongs to. + * @return a Dechunking result detailing whether or not dechunking was successful, and + * if any items were skipped. + * @throws Exception, specifically throws IllegalArgumentException if either the chunk + * or StepExecution is null. + */ + DechunkingResult dechunk(Chunk chunk, StepExecution stepExecution) throws Exception; }