org.mule.umo.routing
Interface UMOResponseRouter

All Superinterfaces:
UMORouter
All Known Implementing Classes:
AbstractResponseRouter

public interface UMOResponseRouter
extends UMORouter

UMOResponseRouter is a router that handles response flow Response Agrregators are used to collect responses that are usually sent to replyTo endpoints set on outbound routers. When an event is sent out via an outbound router, the response router will block the response flow on an UMOComponent until the Response Router resolves a reply or times out.

Version:
$Revision: 3798 $
Author:
Ross Mason

Method Summary
 UMOMessage getResponse(UMOMessage message)
          Called by the Mule framework once the outbound router has been processed on a component the Message passed in is the response message from the component (or outbount router if a response was returned).
 int getTimeout()
          Returns the timeout delay that the response router should wait for a response for a given event.
 void process(UMOEvent event)
          This method is invoked when an event is received via an endpoint on this Response Router.
 void setTimeout(int timeout)
          Sets the timeout delay that the response router should wait for a response for a given event.
 
Methods inherited from interface org.mule.umo.routing.UMORouter
getRouterStatistics, setRouterStatistics
 

Method Detail

process

public void process(UMOEvent event)
             throws RoutingException
This method is invoked when an event is received via an endpoint on this Response Router. It is responsible for tieing up the event it receives with responses waiting to return back to the callee. This method will be called by a different thread to the getResponse method. The getResponse() method block the response execution until the process method signals that a match is found.

Parameters:
event -
Throws:
RoutingException

getResponse

public UMOMessage getResponse(UMOMessage message)
                       throws RoutingException
Called by the Mule framework once the outbound router has been processed on a component the Message passed in is the response message from the component (or outbount router if a response was returned). This method is invoked to signal that the event flow for the component has completed and what ever message is returned from this method with be sent back as the response. This method will block until the correct response for the given Message has been received.

Parameters:
message - The processed message from the Component
Returns:
the response message sent back to the callee
Throws:
RoutingException
See Also:
UMOMessage, UMOComponent

setTimeout

public void setTimeout(int timeout)
Sets the timeout delay that the response router should wait for a response for a given event. If the time expires and exception will be thrown by Mule.

Parameters:
timeout - the time in milliseconds to wait for a response event

getTimeout

public int getTimeout()
Returns the timeout delay that the response router should wait for a response for a given event. If the time expires and exception will be thrown by Mule.

Returns:
the time in milliseconds to wait for a response event


Copyright © 2003-2006 MuleSource Inc.. All Rights Reserved.