View Javadoc

1   /*
2    * $Id: MatchingRouter.java 20320 2010-11-24 15:03: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.processor.MessageProcessor;
14  
15  /**
16   * Routes the message to zero or more <code>MatchableMessageProcessor</code>s. Which route(s) are used used is
17   * defined by implementations of this interface which use the
18   * {@link Matchable#isMatch(org.mule.api.MuleEvent) method of the routers to determine if a router accept the
19   * event or not.
20   * <p>
21   * Different implementations may route to the first match, or to all matches or you some other strategy. If
22   * the implementation supports the use of a default route then this will be used to route any events that
23   * don't match any other routes.
24   */
25  public interface MatchingRouter extends MessageProcessor
26  {
27  
28      void addRoute(MatchableMessageProcessor matchable);
29  
30      void removeRoute(MatchableMessageProcessor matchable);
31  
32  }