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.

This commit is contained in:
lucasward
2008-02-14 05:45:13 +00:00
parent d93459fda1
commit d54166e607

View File

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