org.springframework.integration.aggregator
Class MessageGroup

java.lang.Object
  extended by org.springframework.integration.aggregator.MessageGroup

public class MessageGroup
extends java.lang.Object

Represents an mutable group of correlated messages that is bound to a certain MessageStore and correlation key. The group will grow during its lifetime, when messages are added to it. This is not thread safe and should not be used for long running aggregations.

According to its CompletionStrategy it can be complete depending on the messages in the group.

Optionally MessageGroupListeners can be added to get callbacks when (parts of) the group are processed or the whole group is completed.

Author:
Iwein Fuld, Oleg Zhurakousky

Constructor Summary
MessageGroup(java.util.Collection<? extends Message<?>> originalMessages, CompletionStrategy completionStrategy, java.lang.Object correlationKey, MessageGroupListener... listeners)
           
 
Method Summary
 void add(Message<?> message)
           
 java.lang.Object getCorrelationKey()
           
 java.util.List<Message<?>> getMessages()
           
 boolean hasNoMessageSuperseding(Message<?> message)
           
 boolean isComplete()
           
 void onCompletion()
           
 void onProcessingOf(Message... messages)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageGroup

public MessageGroup(java.util.Collection<? extends Message<?>> originalMessages,
                    CompletionStrategy completionStrategy,
                    java.lang.Object correlationKey,
                    MessageGroupListener... listeners)
Method Detail

hasNoMessageSuperseding

public boolean hasNoMessageSuperseding(Message<?> message)

add

public void add(Message<?> message)

isComplete

public boolean isComplete()

getMessages

public java.util.List<Message<?>> getMessages()

getCorrelationKey

public java.lang.Object getCorrelationKey()

onProcessingOf

public void onProcessingOf(Message... messages)

onCompletion

public void onCompletion()