Spring Integration

Class AbstractAggregatingMessageGroupProcessor

  extended by org.springframework.integration.aggregator.AbstractAggregatingMessageGroupProcessor
All Implemented Interfaces:
Direct Known Subclasses:
DefaultAggregatingMessageGroupProcessor, ExpressionEvaluatingMessageGroupProcessor, MethodInvokingMessageGroupProcessor

public abstract class AbstractAggregatingMessageGroupProcessor
extends java.lang.Object
implements MessageGroupProcessor

Base class for MessageGroupProcessor implementations that aggregate the group of Messages into a single Message.

Iwein Fuld, Alexander Peters, Mark Fisher, Dave Syer

Constructor Summary
Method Summary
protected  java.util.Map<java.lang.String,java.lang.Object> aggregateHeaders(MessageGroup group)
          This default implementation simply returns all headers that have no conflicts among the group.
protected abstract  java.lang.Object aggregatePayloads(MessageGroup group, java.util.Map<java.lang.String,java.lang.Object> defaultHeaders)
 java.lang.Object processMessageGroup(MessageGroup group)
          Process the given MessageGroup.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public AbstractAggregatingMessageGroupProcessor()
Method Detail


public final java.lang.Object processMessageGroup(MessageGroup group)
Description copied from interface: MessageGroupProcessor
Process the given MessageGroup. Implementations are free to return as few or as many messages based on the invocation as needed. For example an aggregating processor will return only a single message representing the group, while a resequencing processor will return all messages whose preceding sequence has been satisfied.

If a multiple messages are returned the return value must be a Collection<Message>.

Specified by:
processMessageGroup in interface MessageGroupProcessor


protected java.util.Map<java.lang.String,java.lang.Object> aggregateHeaders(MessageGroup group)
This default implementation simply returns all headers that have no conflicts among the group. An absent header on one or more Messages within the group is not considered a conflict. Subclasses may override this method with more advanced conflict-resolution strategies if necessary.


protected abstract java.lang.Object aggregatePayloads(MessageGroup group,
                                                      java.util.Map<java.lang.String,java.lang.Object> defaultHeaders)

Spring Integration