org.mule.routing.response
Class AbstractResponseRouter

java.lang.Object
  extended by org.mule.routing.AbstractRouter
      extended by org.mule.routing.response.AbstractResponseRouter
All Implemented Interfaces:
UMOResponseRouter, UMORouter
Direct Known Subclasses:
AbstractResponseAggregator

public abstract class AbstractResponseRouter
extends AbstractRouter
implements UMOResponseRouter

AbstractResponseRouter is a base class for all Response Routers


Field Summary
protected  PropertyExtractor correlationExtractor
           
protected  Log logger
           
 
Constructor Summary
AbstractResponseRouter()
           
 
Method Summary
protected  Object getCallResponseAggregateIdentifier(UMOMessage message)
          Extracts a Group identifier from the current event.
 PropertyExtractor getCorrelationExtractor()
           
protected  Object getReplyAggregateIdentifier(UMOMessage message)
          Extracts a 'Correlation Id' from a reply message.
 int getTimeout()
          Returns the timeout delay that the response router should wait for a response for a given event.
 boolean isFailOnTimeout()
          Should the router fail and throw an exception if a timeout occurs or should it return the events received so far.
 void setCorrelationExtractor(PropertyExtractor correlationExtractor)
           
 void setFailOnTimeout(boolean failOnTimeout)
          Should the router fail and throw an exception if a timeout occurs or should it return the events received so far.
 void setPropertyExtractorAsString(String className)
          A digester callback to configure a custom correlation extractor.
 void setTimeout(int timeout)
          Sets the timeout delay that the response router should wait for a response for a given event.
 
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.UMOResponseRouter
getResponse, process
 
Methods inherited from interface org.mule.umo.routing.UMORouter
getRouterStatistics, setRouterStatistics
 

Field Detail

logger

protected final Log logger

correlationExtractor

protected PropertyExtractor correlationExtractor
Constructor Detail

AbstractResponseRouter

public AbstractResponseRouter()
Method Detail

getCorrelationExtractor

public PropertyExtractor getCorrelationExtractor()

setCorrelationExtractor

public void setCorrelationExtractor(PropertyExtractor correlationExtractor)

setPropertyExtractorAsString

public void setPropertyExtractorAsString(String className)
A digester callback to configure a custom correlation extractor.

Parameters:
className - correlation extractor fully qualified class name

getTimeout

public int getTimeout()
Description copied from interface: UMOResponseRouter
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.

Specified by:
getTimeout in interface UMOResponseRouter
Returns:
the time in milliseconds to wait for a response event

setTimeout

public void setTimeout(int timeout)
Description copied from interface: UMOResponseRouter
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.

Specified by:
setTimeout in interface UMOResponseRouter
Parameters:
timeout - the time in milliseconds to wait for a response event

getReplyAggregateIdentifier

protected Object getReplyAggregateIdentifier(UMOMessage message)
Extracts a 'Correlation Id' from a reply message. The correlation Id does not have to be the Message Correlation Id. It can be extracted from the message payload if desired.

Parameters:
message - a received reply message
Returns:
the correlation Id for this message

getCallResponseAggregateIdentifier

protected Object getCallResponseAggregateIdentifier(UMOMessage message)
Extracts a Group identifier from the current event. When an event is received with a group identifier not registered with this router, a new group is created. The id returned here can be a correlationId or some custom aggregation Id. This implementation uses the Unique Message Id of the UMOMessage being returned a

Parameters:
message - A response messages received on the response router endpoint
Returns:
an aggregation Id for this event

isFailOnTimeout

public boolean isFailOnTimeout()
Description copied from interface: UMOResponseRouter
Should the router fail and throw an exception if a timeout occurs or should it return the events received so far. //TODO This method is not implemented yet

Specified by:
isFailOnTimeout in interface UMOResponseRouter
Returns:

setFailOnTimeout

public void setFailOnTimeout(boolean failOnTimeout)
Description copied from interface: UMOResponseRouter
Should the router fail and throw an exception if a timeout occurs or should it return the events received so far. //TODO This method is not implemented yet

Specified by:
setFailOnTimeout in interface UMOResponseRouter


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