From be7cea1603b26ab6b9e51fd6c4cf4c34e560effb Mon Sep 17 00:00:00 2001 From: dsyer Date: Fri, 11 Sep 2009 09:38:25 +0000 Subject: [PATCH] RESOLVED - issue BATCH-1399: Expose StepExecutionAggregator as a strategy interface in PartitionStep --- .../DefaultStepExecutionAggregator.java | 14 +++++++++----- .../support/StepExecutionAggregator.java | 19 ++++++++++--------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregator.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregator.java index b2bf2ad52..e1328dd62 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregator.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregator.java @@ -19,6 +19,7 @@ package org.springframework.batch.core.partition.support; import java.util.Collection; import org.springframework.batch.core.BatchStatus; +import org.springframework.batch.core.ExitStatus; import org.springframework.batch.core.StepExecution; import org.springframework.util.Assert; @@ -32,11 +33,14 @@ import org.springframework.util.Assert; public class DefaultStepExecutionAggregator implements StepExecutionAggregator { /** - * Aggregates the status and exit status using their built in combination - * rules (i.e. {@link BatchStatus#max(BatchStatus, BatchStatus) max} and - * {@link ExitStatus#and(ExitStatus) and} respectively), and the counters by - * simple arithmetic. - * + * Aggregates the input executions into the result {@link StepExecution}. + * The aggregated fields are + * * @see StepExecutionAggregator #aggregate(StepExecution, Collection) */ public void aggregate(StepExecution result, Collection executions) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/StepExecutionAggregator.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/StepExecutionAggregator.java index 4b5c1692a..570ce5879 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/StepExecutionAggregator.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/StepExecutionAggregator.java @@ -2,20 +2,21 @@ package org.springframework.batch.core.partition.support; import java.util.Collection; -import org.springframework.batch.core.BatchStatus; -import org.springframework.batch.core.ExitStatus; import org.springframework.batch.core.StepExecution; +/** + * Strategy for a aggregating step executions, usually when they are the result + * of partitioned or remote execution. + * + * @author Dave Syer + * + * @since 2.1 + * + */ public interface StepExecutionAggregator { /** - * Take the inputs and aggregate certain fields, putting the aggregates into - * the result. The aggregated fields are - * + * Take the inputs and aggregate, putting the aggregates into the result. * * @param result the result to overwrite * @param executions the inputs