org.mule.routing.response
Class SingleResponseRouter

java.lang.Object
  extended byorg.mule.routing.AbstractRouter
      extended byorg.mule.routing.response.AbstractResponseRouter
          extended byorg.mule.routing.response.AbstractResponseAggregator
              extended byorg.mule.routing.response.SingleResponseRouter
All Implemented Interfaces:
UMOResponseRouter, UMORouter

public class SingleResponseRouter
extends AbstractResponseAggregator

Handles single event responses from a replyTo address. If multiple responses will be received for a single invocation, the ResponseCorrelationAggregator should be used.


Field Summary
 
Fields inherited from class org.mule.routing.response.AbstractResponseAggregator
eventGroups, locks, responseMessages
 
Fields inherited from class org.mule.routing.response.AbstractResponseRouter
correlationExtractor, logger
 
Constructor Summary
SingleResponseRouter()
           
 
Method Summary
protected  UMOMessage aggregateEvents(EventGroup events)
          The SingleResponseRouter will always return the first event of an event group.
protected  boolean shouldAggregateEvents(EventGroup events)
          The SingleResponseRouter will return true if the event group size is 1.
 
Methods inherited from class org.mule.routing.response.AbstractResponseAggregator
addEventGroup, createEventGroup, getEventGroup, getResponse, process, removeEventGroup
 
Methods inherited from class org.mule.routing.response.AbstractResponseRouter
getCallResponseAggregateIdentifier, getCorrelationExtractor, getReplyAggregateIdentifier, getTimeout, isFailOnTimeout, setCorrelationExtractor, setFailOnTimeout, setPropertyExtractorAsString, setTimeout
 
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

SingleResponseRouter

public SingleResponseRouter()
Method Detail

shouldAggregateEvents

protected boolean shouldAggregateEvents(EventGroup events)
The SingleResponseRouter will return true if the event group size is 1. If the group size is greater than 1, a warning will be logged.

Specified by:
shouldAggregateEvents in class AbstractResponseAggregator
Parameters:
events -
Returns:
true if the event group size is 1 or greater
See Also:
{@link AbstractResponseAggregator#shouldAggregateEvents(EventGroup)}

aggregateEvents

protected UMOMessage aggregateEvents(EventGroup events)
                              throws RoutingException
The SingleResponseRouter will always return the first event of an event group.

Specified by:
aggregateEvents in class AbstractResponseAggregator
Parameters:
events - the event group for this request
Returns:
an aggregated message
Throws:
RoutingException - if the aggregation fails. in this scenario the whole event group is removed and passed to the exception handler for this componenet
See Also:
{@link AbstractResponseAggregator#aggregateEvents(EventGroup)}


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