View Javadoc

1   /*
2    * $Id: OutboundRouter.java 19547 2010-09-10 12:22:31Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.api.routing;
12  
13  import org.mule.api.construct.FlowConstructAware;
14  import org.mule.api.context.MuleContextAware;
15  import org.mule.api.lifecycle.Lifecycle;
16  import org.mule.api.processor.MessageProcessor;
17  import org.mule.api.transaction.TransactionConfig;
18  
19  import java.util.List;
20  
21  /**
22   * <code>OutboundRouter</code> is used to control outbound routing behaviour for an
23   * event. One or more Outbound routers can be associated with an
24   * <code>OutboundRouterCollection</code> and will be selected based on the filters
25   * set on the individual Outbound Router.
26   * 
27   * @see OutboundRouterCollection
28   */
29  public interface OutboundRouter
30      extends MatchableMessageRouter, RouterStatisticsRecorder, Lifecycle, MuleContextAware, FlowConstructAware
31  {
32  
33      void setTransactionConfig(TransactionConfig transactionConfig);
34  
35      /**
36       * Sets the replyTo route for any outgoing messages. This will then be used by
37       * other Mule routers to send replies back for this message. If the underlying
38       * protocol supports replyTo messages, such as Jms, a Jms Destination will be
39       * attached to the outbound message
40       * 
41       * @param replyTo route string to use
42       */
43      void setReplyTo(String replyTo);
44  
45      /**
46       * Determines whether this router supports dynamic route. i.e. routes that are
47       * not configured at design time. routes might be pulled from the message or
48       * payload.
49       */
50      boolean isDynamicRoutes();
51  
52      /**
53       * Gets a list of MessageProcessor instances associated with this router
54       * 
55       * @return a list of MessageProcessor instances
56       */
57      List<MessageProcessor> getRoutes();
58  
59  }