org.mule.routing.inbound
Class CorrelationAggregator

java.lang.Object
  extended by org.mule.routing.AbstractRouter
      extended by org.mule.routing.inbound.SelectiveConsumer
          extended by org.mule.routing.inbound.AbstractEventAggregator
              extended by org.mule.routing.inbound.CorrelationAggregator
All Implemented Interfaces:
UMOInboundRouter, UMORouter
Direct Known Subclasses:
BankQuotesInboundAggregator, MessageChunkingAggregator

public abstract class CorrelationAggregator
extends AbstractEventAggregator

CorrelationAggregator uses the CorrelationID and CorrelationGroupSize properties of the UMOMessage to manage message groups.


Field Summary
 
Fields inherited from class org.mule.routing.inbound.AbstractEventAggregator
NO_CORRELATION_ID
 
Fields inherited from class org.mule.routing.inbound.SelectiveConsumer
logger
 
Constructor Summary
CorrelationAggregator()
           
 
Method Summary
protected  EventGroup createEventGroup(UMOEvent event, Object groupId)
          Creates a new EventGroup that will expect the number of events as returned by UMOMessageAdapter.getCorrelationGroupSize().
protected  boolean shouldAggregateEvents(EventGroup events)
          Determines if the event group is ready to be aggregated.
 
Methods inherited from class org.mule.routing.inbound.AbstractEventAggregator
addEventGroup, aggregateEvents, getEventGroup, getEventGroupIdForEvent, process, removeEventGroup
 
Methods inherited from class org.mule.routing.inbound.SelectiveConsumer
getFilter, isMatch, isTransformFirst, setFilter, setTransformFirst
 
Methods inherited from class org.mule.routing.AbstractRouter
getRouterStatistics, setRouterStatistics
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mule.umo.routing.UMORouter
getRouterStatistics, setRouterStatistics
 

Constructor Detail

CorrelationAggregator

public CorrelationAggregator()
Method Detail

createEventGroup

protected EventGroup createEventGroup(UMOEvent event,
                                      Object groupId)
Creates a new EventGroup that will expect the number of events as returned by UMOMessageAdapter.getCorrelationGroupSize().

Overrides:
createEventGroup in class AbstractEventAggregator
Parameters:
event - the event that caused creation of this group; can be used for additional information
groupId - the id to use for the new EventGroup
Returns:
a new EventGroup

shouldAggregateEvents

protected boolean shouldAggregateEvents(EventGroup events)
Description copied from class: AbstractEventAggregator
Determines if the event group is ready to be aggregated. if the group is ready to be aggregated (this is entirely up to the application. it could be determined by volume, last modified time or some oher criteria based on the last event received).

Specified by:
shouldAggregateEvents in class AbstractEventAggregator
Returns:
true if the correlation size is not set or exactly the expected size of the event group.
See Also:
AbstractEventAggregator.shouldAggregateEvents(EventGroup)


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.