org.mule.routing
Class AbstractCatchAllStrategy

java.lang.Object
  extended by org.mule.routing.AbstractCatchAllStrategy
All Implemented Interfaces:
RouterCatchAllStrategy
Direct Known Subclasses:
ForwardingCatchAllStrategy, LoggingCatchAllStrategy, ServiceCatchAllStrategy

public abstract class AbstractCatchAllStrategy
extends Object
implements RouterCatchAllStrategy

RouterCatchAllStrategy is a strategy interface that allows developers to hook in custom code when an event is being routed on the inbound or outbound but does not match any of the criteria defined for the routing. Think of catch all strategies as a safety net for your events to ensure that all events will get processed. If you do not use conditional routing logic, you will not need a catch all strategy. Note that it is advised to use this base class over the RouterCatchAllStrategy interface so that the RouterStatistics are available.

See Also:
LoggingCatchAllStrategy, ForwardingCatchAllStrategy

Field Summary
protected  Log logger
          logger used by this class
protected  RouterStatistics statistics
          Router statistics used to monitor if a catch all strategy is invoked and if any events are dispatched from the strategy i.e.
 
Constructor Summary
AbstractCatchAllStrategy()
           
 
Method Summary
 MuleMessage catchMessage(MuleMessage message, MuleSession session)
          This method will be invoked when an event is received or being sent where the criteria of the router(s) do not match the current event.
abstract  MuleMessage doCatchMessage(MuleMessage message, MuleSession session)
           
 RouterStatistics getStatistics()
           
 void setStatistics(RouterStatistics statistics)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected transient Log logger
logger used by this class


statistics

protected RouterStatistics statistics
Router statistics used to monitor if a catch all strategy is invoked and if any events are dispatched from the strategy i.e. from the ForwardingCatchAllStrategy.

Constructor Detail

AbstractCatchAllStrategy

public AbstractCatchAllStrategy()
Method Detail

getStatistics

public RouterStatistics getStatistics()

setStatistics

public void setStatistics(RouterStatistics statistics)

catchMessage

public final MuleMessage catchMessage(MuleMessage message,
                                      MuleSession session)
                               throws RoutingException
This method will be invoked when an event is received or being sent where the criteria of the router(s) do not match the current event.

Specified by:
catchMessage in interface RouterCatchAllStrategy
Parameters:
message - the current message being processed
session - the current session
Returns:
A result message from this processing. Depending on the messaging style being used this might become the response message to a client or remote service call.
Throws:
RoutingException - if there is a failure while processing this message.

doCatchMessage

public abstract MuleMessage doCatchMessage(MuleMessage message,
                                           MuleSession session)
                                    throws RoutingException
Throws:
RoutingException


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