org.mule.routing.nested
Class DefaultNestedRouter

java.lang.Object
  extended by org.mule.routing.AbstractRouter
      extended by org.mule.routing.nested.DefaultNestedRouter
All Implemented Interfaces:
MuleContextAware, Disposable, Initialisable, NestedRouter, Router

public class DefaultNestedRouter
extends AbstractRouter
implements NestedRouter


Field Summary
protected  OutboundRouter outboundRouter
           
 
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
DefaultNestedRouter()
           
 
Method Summary
 Object createProxy(Object target)
          This wires the dynamic proxy to the service object.
 OutboundEndpoint getEndpoint()
           
 Class getInterface()
           
 Class getInterfaceClass()
           
 String getMethod()
           
 MuleMessage route(MuleMessage message, MuleSession session, boolean synchronous)
          This method is responsible for routing the Message via the MuleSession.
 void setEndpoint(OutboundEndpoint e)
           
 void setInterface(Class interfaceClass)
           
 void setMethod(String methodName)
           
 String toString()
           
 
Methods inherited from class org.mule.routing.AbstractRouter
dispose, getMuleContext, getRouterStatistics, initialise, setMuleContext, setRouterStatistics
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.api.routing.Router
getRouterStatistics, setRouterStatistics
 
Methods inherited from interface org.mule.api.lifecycle.Initialisable
initialise
 
Methods inherited from interface org.mule.api.lifecycle.Disposable
dispose
 

Field Detail

outboundRouter

protected OutboundRouter outboundRouter
Constructor Detail

DefaultNestedRouter

public DefaultNestedRouter()
Method Detail

route

public MuleMessage route(MuleMessage message,
                         MuleSession session,
                         boolean synchronous)
                  throws MessagingException
Description copied from interface: NestedRouter
This method is responsible for routing the Message via the MuleSession. The logic for this method will change for each type of router depending on expected behaviour. For example, a MulticastingRouter might just iterate through the list of assoaciated endpoints sending the message. Another type of router such as the ExceptionBasedRouter will hit the first endpoint, if it fails try the second, and so on. Most router implementations will extends the FilteringOutboundRouter which implements all the common logic need for a router.

Specified by:
route in interface NestedRouter
Parameters:
message - the message to send via one or more endpoints on this router
session - the session used to actually send the event
synchronous - whether the invocation process should be synchronous or not
Returns:
a result message if any from the invocation. If the synchronous flag is false a null result will always be returned.
Throws:
MessagingException - if any errors occur during the sending of messages
See Also:
FilteringOutboundRouter, ExceptionBasedRouter, MulticastingRouter

setInterface

public void setInterface(Class interfaceClass)
Specified by:
setInterface in interface NestedRouter

getInterface

public Class getInterface()
Specified by:
getInterface in interface NestedRouter

getMethod

public String getMethod()
Specified by:
getMethod in interface NestedRouter

setMethod

public void setMethod(String methodName)
Specified by:
setMethod in interface NestedRouter

createProxy

public Object createProxy(Object target)
Description copied from interface: NestedRouter
This wires the dynamic proxy to the service object.

Specified by:
createProxy in interface NestedRouter

setEndpoint

public void setEndpoint(OutboundEndpoint e)
Specified by:
setEndpoint in interface NestedRouter

getInterfaceClass

public Class getInterfaceClass()

toString

public String toString()
Overrides:
toString in class Object

getEndpoint

public OutboundEndpoint getEndpoint()
Specified by:
getEndpoint in interface NestedRouter


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