View Javadoc

1   /*
2    * $Id: OutboundRouterCatchAllStrategy.java 19191 2010-08-25 21:05:23Z tcarlson $
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.MuleEvent;
14  import org.mule.api.processor.MessageProcessor;
15  
16  /**
17   * <code>RouterCatchAllStrategy</code> is a strategy interface that allows developers to hook in custom code when
18   * an event is being routed on the inbound or outbound but does not match any of the criteria defined for the routing.
19   *
20   * Think of catch all strategies as a safety net for your events to ensure that all events will get processed.  If you
21   * do not use conditional routing logic, you will not need a catch all strategy.
22   *
23   */
24  public interface OutboundRouterCatchAllStrategy extends MessageProcessor
25  {
26      /**
27       * This method will be invoked when an event is received or being sent where the criteria of the router(s) do not
28       * match the current event.
29       * @param event the current event being processed
30       *
31       * @return A result message from this processing. Depending on the messaging style being used this might become the
32       * response message to a client or remote service call.
33       * @throws RoutingException if there is a failure while processing this message.
34       */
35      MuleEvent process(MuleEvent event) throws RoutingException;
36  }