From 7ffab20b45c758552bc82a36e9be8104900fd8b9 Mon Sep 17 00:00:00 2001 From: Marius Bogoevici Date: Mon, 20 Oct 2008 16:42:22 +0000 Subject: [PATCH] More updates to the aggregator documentation. --- .../src/aggregator-resequencer.xml | 46 ++++++++++++++----- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/spring-integration-reference/src/aggregator-resequencer.xml b/spring-integration-reference/src/aggregator-resequencer.xml index d21dd30e80..fd4c34d083 100644 --- a/spring-integration-reference/src/aggregator-resequencer.xml +++ b/spring-integration-reference/src/aggregator-resequencer.xml @@ -111,7 +111,8 @@ implementing the aggregateMessages method is left to the developer): - public abstract class AbstractMessageAggregator extends AbstractMessageBarrierConsumer { + public abstract class AbstractMessageAggregator + extends AbstractMessageBarrierConsumer { private volatile CompletionStrategy completionStrategy = new SequenceSizeCompletionStrategy(); @@ -138,8 +139,8 @@ if the argument is a parametrized java.util.List, and the parameter type is assignable to Message, then the whole list of - messages accumulated for aggregation will be sent to the aggregator - + messages accumulated for aggregation will be sent to the + aggregator @@ -216,7 +217,7 @@ on how to define such an element is presented below, as well as it: - <channel id="inputChannel"/> + <channel id="inputChannel"/> <aggregator id="completelyDefinedAggregator" input-channel="inputChannel" @@ -341,7 +342,7 @@ An implementation of the completion strategy bean for the example above may be as follows: - public class PojoCompletionStrategy { + public class PojoCompletionStrategy { ... public boolean checkCompleteness(List<Long> numbers) { int sum = 0; @@ -362,7 +363,7 @@ A sample resequencer configuration is shown below. - <channel id="inputChannel"/> + <channel id="inputChannel"/> <channel id="outputChannel"/> @@ -449,20 +450,43 @@ An aggregator configured using annotations can look like this. - public class Waiter { + public class Waiter { ... - @Aggregator + @Aggregator public Delivery aggregatingMethod(List<OrderItem> items) { ... } - @CompletionStrategy + @CompletionStrategy public boolean completionChecker(List<Message<?>> messages) { ... } -} - +} + + + + An annotation indicating that this method shall be used as an + aggregator. Must be specified if this class will be used as an + aggregator. + + + + An annotation indicating that this method shall be + used as the completion strategy of an aggregator. If not present of + the method, the aggregator will use the + SequenceSizeCompletionStrategy. + + + + + + All the configuration options provided by xml element are available + for the @Aggregator annotation. + + The aggregator can be either referenced explicitely from XML or, if + the @MessageEndpoint is defined on the class, detected automatically + through classpath scanning.