org.mule.routing.response
Class SingleResponseRouter

java.lang.Object
  extended by org.mule.routing.AbstractRouter
      extended by org.mule.routing.response.AbstractResponseRouter
          extended by org.mule.routing.response.AbstractResponseAggregator
              extended by org.mule.routing.response.SingleResponseRouter
All Implemented Interfaces:
MuleContextAware, Disposable, Initialisable, ResponseRouter, Router

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, MAX_PROCESSED_GROUPS, processedGroups, responseMessages
 
Fields inherited from class org.mule.routing.response.AbstractResponseRouter
logger, messageInfoMapping
 
Fields inherited from class org.mule.routing.AbstractRouter
muleContext
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
SingleResponseRouter()
           
 
Method Summary
protected  MuleMessage 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, addProcessedGroup, createEventGroup, getEventGroup, getResponse, getTimeout, initialise, isFailOnTimeout, isGroupAlreadyProcessed, process, removeEventGroup, setFailOnTimeout, setTimeout
 
Methods inherited from class org.mule.routing.response.AbstractResponseRouter
getCallResponseAggregateIdentifier, getMessageInfoMapping, getReplyAggregateIdentifier, setMessageInfoMapping
 
Methods inherited from class org.mule.routing.AbstractRouter
dispose, getMuleContext, getRouterStatistics, setMuleContext, 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.api.routing.Router
getRouterStatistics, setRouterStatistics
 
Methods inherited from interface org.mule.api.lifecycle.Disposable
dispose
 

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:
AbstractResponseAggregator#shouldAggregateEvents(EventGroup)}

aggregateEvents

protected MuleMessage 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:
AbstractResponseAggregator#aggregateEvents(EventGroup)}


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