org.mule.examples.loanbroker.routers
Class BankQuotesInboundAggregator

java.lang.Object
  extended byorg.mule.routing.AbstractRouter
      extended byorg.mule.routing.inbound.SelectiveConsumer
          extended byorg.mule.routing.inbound.AbstractEventAggregator
              extended byorg.mule.routing.inbound.CorrelationAggregator
                  extended byorg.mule.examples.loanbroker.routers.BankQuotesInboundAggregator
All Implemented Interfaces:
UMOInboundRouter, UMORouter

public class BankQuotesInboundAggregator
extends CorrelationAggregator

BankQuotesInboundAggregator receives a number of quotes and selects the lowest


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
BankQuotesInboundAggregator()
           
 
Method Summary
protected  UMOMessage aggregateEvents(EventGroup events)
          This method is invoked if the shouldAggregate method is called and returns true.
protected  boolean shouldAggregateEvents(EventGroup events)
          Determines if the event group is ready to be aggregated; this is entirely up to the application.
 
Methods inherited from class org.mule.routing.inbound.CorrelationAggregator
createEventGroup
 
Methods inherited from class org.mule.routing.inbound.AbstractEventAggregator
addEventGroup, 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

BankQuotesInboundAggregator

public BankQuotesInboundAggregator()
Method Detail

aggregateEvents

protected UMOMessage aggregateEvents(EventGroup events)
                              throws AggregationException
This method is invoked if the shouldAggregate method is called and returns true. Once this method returns an aggregated message the event group is removed from the router

Specified by:
aggregateEvents in class AbstractEventAggregator
Parameters:
events - the event group for this request
Returns:
an aggregated message
Throws:
AggregationException - if the aggregation fails. in this scenario the whole event group is removed and passed to the exception handler for this componenet

shouldAggregateEvents

protected boolean shouldAggregateEvents(EventGroup events)
Determines if the event group is ready to be aggregated; this is entirely up to the application. It could be determined by volume, last modified time or some other criteria based on the last event received.

Overrides:
shouldAggregateEvents in class CorrelationAggregator
Parameters:
events - event group to examine
Returns:
true if the events are ready to be aggregated
See Also:
AbstractEventAggregator.shouldAggregateEvents(EventGroup)


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