org.mule.routing.response
Class DefaultResponseRouterCollection

java.lang.Object
  extended by org.mule.routing.AbstractRouterCollection
      extended by org.mule.routing.response.DefaultResponseRouterCollection
All Implemented Interfaces:
MuleContextAware, Disposable, Initialisable, ResponseRouterCollection, RouterCollection

public class DefaultResponseRouterCollection
extends AbstractRouterCollection
implements ResponseRouterCollection

DefaultResponseRouterCollection is a router that can be used to control how the response in a request/response message flow is created. Main usecase is to aggregate a set of asynchonous events into a single response


Field Summary
 
Fields inherited from class org.mule.routing.AbstractRouterCollection
logger, matchAll, muleContext, routers
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
DefaultResponseRouterCollection()
           
 
Method Summary
 void addEndpoint(InboundEndpoint endpoint)
           
 void addRouter(Router router)
           
 InboundEndpoint getEndpoint(String name)
           
 List getEndpoints()
           
 MuleMessage getResponse(MuleMessage message)
           
 int getTimeout()
           
 boolean hasEndpoints()
           
 void initialise()
          Method used to perform any initialisation work.
 boolean isFailOnTimeout()
           
 boolean removeEndpoint(InboundEndpoint endpoint)
           
 ResponseRouter removeRouter(ResponseRouter router)
           
 void route(MuleEvent event)
           
 void setEndpoints(List endpoints)
           
 void setFailOnTimeout(boolean failOnTimeout)
           
 void setTimeout(int timeout)
           
 
Methods inherited from class org.mule.routing.AbstractRouterCollection
dispose, getCatchAllStrategy, getRouters, getStatistics, isMatchAll, removeRouter, setCatchAllStrategy, setMatchAll, setMuleContext, setRouters, setStatistics
 
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.RouterCollection
getCatchAllStrategy, getRouters, getStatistics, isMatchAll, removeRouter, setCatchAllStrategy, setMatchAll, setRouters, setStatistics
 
Methods inherited from interface org.mule.api.lifecycle.Disposable
dispose
 

Constructor Detail

DefaultResponseRouterCollection

public DefaultResponseRouterCollection()
Method Detail

initialise

public void initialise()
                throws InitialisationException
Description copied from interface: Initialisable
Method used to perform any initialisation work. If a fatal error occurs during initialisation an InitialisationException should be thrown, causing the Mule instance to shutdown. If the error is recoverable, say by retrying to connect, a RecoverableException should be thrown. There is no guarantee that by throwing a Recoverable exception that the Mule instance will not shut down.

Specified by:
initialise in interface Initialisable
Overrides:
initialise in class AbstractRouterCollection
Throws:
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered from

route

public void route(MuleEvent event)
           throws RoutingException
Specified by:
route in interface ResponseRouterCollection
Throws:
RoutingException

getResponse

public MuleMessage getResponse(MuleMessage message)
                        throws RoutingException
Specified by:
getResponse in interface ResponseRouterCollection
Throws:
RoutingException

addRouter

public void addRouter(Router router)
Specified by:
addRouter in interface RouterCollection
Overrides:
addRouter in class AbstractRouterCollection

removeRouter

public ResponseRouter removeRouter(ResponseRouter router)
Specified by:
removeRouter in interface ResponseRouterCollection

addEndpoint

public void addEndpoint(InboundEndpoint endpoint)
Specified by:
addEndpoint in interface ResponseRouterCollection

removeEndpoint

public boolean removeEndpoint(InboundEndpoint endpoint)
Specified by:
removeEndpoint in interface ResponseRouterCollection

getEndpoints

public List getEndpoints()
Specified by:
getEndpoints in interface ResponseRouterCollection

setEndpoints

public void setEndpoints(List endpoints)
Specified by:
setEndpoints in interface ResponseRouterCollection

getEndpoint

public InboundEndpoint getEndpoint(String name)
Specified by:
getEndpoint in interface ResponseRouterCollection
Parameters:
name - the Endpoint identifier
Returns:
the Endpoint or null if the endpointUri is not registered
See Also:
InboundRouterCollection

getTimeout

public int getTimeout()
Specified by:
getTimeout in interface ResponseRouterCollection

setTimeout

public void setTimeout(int timeout)
Specified by:
setTimeout in interface ResponseRouterCollection

isFailOnTimeout

public boolean isFailOnTimeout()

setFailOnTimeout

public void setFailOnTimeout(boolean failOnTimeout)

hasEndpoints

public boolean hasEndpoints()
Specified by:
hasEndpoints in interface ResponseRouterCollection


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