org.mule.routing.response
Class ResponseCorrelationAggregator.DefaultEventCorrelatorCallback

java.lang.Object
  extended by org.mule.routing.response.ResponseCorrelationAggregator.DefaultEventCorrelatorCallback
All Implemented Interfaces:
EventCorrelatorCallback
Enclosing class:
ResponseCorrelationAggregator

public class ResponseCorrelationAggregator.DefaultEventCorrelatorCallback
extends Object
implements EventCorrelatorCallback


Constructor Summary
ResponseCorrelationAggregator.DefaultEventCorrelatorCallback()
           
 
Method Summary
 MuleMessage aggregateEvents(EventGroup events)
          This method is invoked if the shouldAggregate method is called and returns true.
 EventGroup createEventGroup(MuleEvent event, Object id)
          Creates the event group with a specific correlation size based on the Mule Correlation support
 boolean shouldAggregateEvents(EventGroup events)
          Determines if the event group is ready to be aggregated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResponseCorrelationAggregator.DefaultEventCorrelatorCallback

public ResponseCorrelationAggregator.DefaultEventCorrelatorCallback()
Method Detail

aggregateEvents

public MuleMessage aggregateEvents(EventGroup events)
                            throws RoutingException
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 interface EventCorrelatorCallback
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 component
RoutingException

shouldAggregateEvents

public boolean shouldAggregateEvents(EventGroup events)
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 interface EventCorrelatorCallback
Parameters:
events -
Returns:
true if the event group is ready of aggregation

createEventGroup

public EventGroup createEventGroup(MuleEvent event,
                                   Object id)
Description copied from interface: EventCorrelatorCallback
Creates the event group with a specific correlation size based on the Mule Correlation support

Specified by:
createEventGroup in interface EventCorrelatorCallback
Parameters:
event - the current event
id - The group id
Returns:
a new event group of a fixed size


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