org.springframework.integration.aggregator
Class AggregationBarrier

java.lang.Object
  extended by org.springframework.integration.aggregator.AbstractMessageBarrier
      extended by org.springframework.integration.aggregator.AggregationBarrier
All Implemented Interfaces:
MessageBarrier

public class AggregationBarrier
extends AbstractMessageBarrier

MessageBarrier implementation for message aggregation. Delegates to a CompletionStrategy to determine when the group of messages is ready for aggregation.

Author:
Marius Bogoevici, Mark Fisher

Field Summary
protected  CompletionStrategy completionStrategy
           
 
Fields inherited from class org.springframework.integration.aggregator.AbstractMessageBarrier
messages
 
Constructor Summary
AggregationBarrier(CompletionStrategy completionStrategy)
           
 
Method Summary
protected  boolean hasReceivedAllMessages()
          Subclasses must implement this method to indicate if all possible messages that could be received by a given barrier have already been received (e.g.
protected  java.util.List<Message<?>> releaseAvailableMessages()
          Subclasses must implement this method to return the messages that can be released by this barrier after the receipt of a given message.
 
Methods inherited from class org.springframework.integration.aggregator.AbstractMessageBarrier
addAndRelease, addMessage, getMessages, getTimestamp, isComplete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

completionStrategy

protected final CompletionStrategy completionStrategy
Constructor Detail

AggregationBarrier

public AggregationBarrier(CompletionStrategy completionStrategy)
Method Detail

releaseAvailableMessages

protected java.util.List<Message<?>> releaseAvailableMessages()
Description copied from class: AbstractMessageBarrier
Subclasses must implement this method to return the messages that can be released by this barrier after the receipt of a given message. It might be possible that a number of messages are released before the barrier has ended its work (partial release) and this depends completely on the implementation of the barrier. However, once hasReceivedAllMessages() is deemed true, only one call to releaseAvailableMessages() shall yield results.

Specified by:
releaseAvailableMessages in class AbstractMessageBarrier

hasReceivedAllMessages

protected boolean hasReceivedAllMessages()
Description copied from class: AbstractMessageBarrier
Subclasses must implement this method to indicate if all possible messages that could be received by a given barrier have already been received (e.g. all messages from a given sequence).

Specified by:
hasReceivedAllMessages in class AbstractMessageBarrier