View Javadoc

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