org.mule.umo.routing
Interface UMOOutboundRouter

All Superinterfaces:
UMORouter
All Known Implementing Classes:
AbstractOutboundRouter

public interface UMOOutboundRouter
extends UMORouter

UMOOutboundRouter is used to control outbound routing behaviour for an event. One or more Outbound routers can be associated with an UMOOutboundRouterCollection and will be selected based on the filters set on the individual Outbound Router.

See Also:
UMOOutboundRouterCollection

Method Summary
 void addEndpoint(UMOEndpoint endpoint)
          Adds an endpoint to this router
 List getEndpoints()
          Gets a list of UMOEndpoint instances associated with this router
 String getReplyTo()
          Gets the replyTo endpoint for any outgoing messages.
 UMOTransactionConfig getTransactionConfig()
           
 boolean isDynamicEndpoints()
          Determines whether this router supports dynamic endpoint.
 boolean isMatch(UMOMessage message)
          Determines if the event should be processed by this router.
 boolean removeEndpoint(UMOImmutableEndpoint endpoint)
          Removes a specific endpoint from the router
 UMOMessage route(UMOMessage message, UMOSession session, boolean synchronous)
          This method is responsible for routing the Message via the Session.
 void setEndpoints(List endpoints)
          Sets a list of UMOEndpoint instances associated with this router
 void setReplyTo(String replyTo)
          Sets the replyTo endpoint for any outgoing messages.
 void setTransactionConfig(UMOTransactionConfig transactionConfig)
           
 
Methods inherited from interface org.mule.umo.routing.UMORouter
getRouterStatistics, setRouterStatistics
 

Method Detail

setEndpoints

public void setEndpoints(List endpoints)
Sets a list of UMOEndpoint instances associated with this router

Parameters:
endpoints - a list of UMOEndpoint instances

getEndpoints

public List getEndpoints()
Gets a list of UMOEndpoint instances associated with this router

Returns:
a list of UMOEndpoint instances

addEndpoint

public void addEndpoint(UMOEndpoint endpoint)
Adds an endpoint to this router

Parameters:
endpoint - the endpoint to add to the router

removeEndpoint

public boolean removeEndpoint(UMOImmutableEndpoint endpoint)
Removes a specific endpoint from the router

Parameters:
endpoint - the endpoint to remove
Returns:
true if the endpoint was removed

route

public UMOMessage route(UMOMessage message,
                        UMOSession session,
                        boolean synchronous)
                 throws MessagingException
This method is responsible for routing the Message via the Session. 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.

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

isMatch

public boolean isMatch(UMOMessage message)
                throws MessagingException
Determines if the event should be processed by this router. Routers can be selectively invoked by configuring a filter on them. Usually the filter is applied to the message when calling this method. All core Mule outbound routers extend the FilteringOutboundRouter router that handles this method automatically.

Parameters:
message - the current message to evaluate
Returns:
true if the event should be processed by this router
Throws:
MessagingException - if the event cannot be evaluated
See Also:
SelectiveConsumer

getTransactionConfig

public UMOTransactionConfig getTransactionConfig()

setTransactionConfig

public void setTransactionConfig(UMOTransactionConfig transactionConfig)

getReplyTo

public String getReplyTo()
Gets the replyTo endpoint for any outgoing messages. This will then be used by other Mule routers to send replies back for this message. If the underlying protocol supports replyTo messages, such as Jms, a Jms Destination will be attached to the outbound message

Returns:
the replyTo endpoint or null if one has not been set.

setReplyTo

public void setReplyTo(String replyTo)
Sets the replyTo endpoint for any outgoing messages. This will then be used by other Mule routers to send replies back for this message. If the underlying protocol supports replyTo messages, such as Jms, a Jms Destination will be attached to the outbound message

Parameters:
replyTo - endpoint string to use

isDynamicEndpoints

public boolean isDynamicEndpoints()
Determines whether this router supports dynamic endpoint. i.e. endpoints that are not configured at design time. Endpoints might be pulled from the message or payload.

Returns:


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