org.mule.routing
Class AbstractCatchAllStrategy

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

public abstract class AbstractCatchAllStrategy
extends Object
implements OutboundRouterCatchAllStrategy, RouterStatisticsRecorder

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 OutboundRouterCatchAllStrategy 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
abstract  MuleEvent doCatchMessage(MuleEvent event)
           
 RouterStatistics getRouterStatistics()
           
 MuleEvent process(MuleEvent event)
          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.
 void setRouterStatistics(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

getRouterStatistics

public RouterStatistics getRouterStatistics()

setRouterStatistics

public void setRouterStatistics(RouterStatistics statistics)
Specified by:
setRouterStatistics in interface RouterStatisticsRecorder

process

public final MuleEvent process(MuleEvent event)
                        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:
process in interface MessageProcessor
Specified by:
process in interface OutboundRouterCatchAllStrategy
Parameters:
event - the current event being processed
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 MuleEvent doCatchMessage(MuleEvent event)
                                  throws RoutingException
Throws:
RoutingException


Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.