org.mule.routing.outbound
Class FilteringOutboundRouter

java.lang.Object
  extended by org.mule.processor.AbstractMuleObjectOwner<MessageProcessor>
      extended by org.mule.processor.AbstractMessageProcessorOwner
          extended by org.mule.routing.outbound.AbstractOutboundRouter
              extended by org.mule.routing.outbound.FilteringOutboundRouter
All Implemented Interfaces:
AnnotatedObject, FlowConstructAware, MuleContextAware, Disposable, Initialisable, Lifecycle, Startable, Stoppable, MessageProcessor, MessageRouter, Matchable, MatchableMessageProcessor, MatchableMessageRouter, OutboundRouter, RouterStatisticsRecorder, TransformingMatchable
Direct Known Subclasses:
AbstractMessageSplitter, AbstractRecipientList, AbstractSequenceRouter, ChainingRouter, EndpointSelector, MessageChunkingRouter, OutboundPassThroughRouter, SxcFilteringOutboundRouter

public class FilteringOutboundRouter
extends AbstractOutboundRouter
implements TransformingMatchable

FilteringRouter is a router that accepts events based on a filter set.


Field Summary
protected  ExpressionManager expressionManager
           
 
Fields inherited from class org.mule.routing.outbound.AbstractOutboundRouter
enableCorrelation, initialised, logger, magicProperties, replyTo, resultsHandler, routes, started, transactionConfig
 
Fields inherited from class org.mule.processor.AbstractMuleObjectOwner
flowConstruct, muleContext
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Stoppable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Fields inherited from interface org.mule.api.AnnotatedObject
PROPERTY_NAME
 
Constructor Summary
FilteringOutboundRouter()
           
 
Method Summary
 void addRoute(MessageProcessor target)
          Adds a new message processor to the list of routes
 Filter getFilter()
           
 MessageProcessor getRoute(int index, MuleEvent event)
          Will Return the target at the given index and will resolve any template tags on the Endpoint URI if necessary
 List<Transformer> getTransformers()
           
 void initialise()
          Method used to perform any initialisation work.
 boolean isMatch(MuleMessage message)
          Determines if the event should be processed
 boolean isTransformBeforeMatch()
           
 boolean isUseTemplates()
           
 MuleEvent route(MuleEvent event)
           
 void setFilter(Filter filter)
           
 void setTransformers(List<Transformer> transformers)
           
 void setUseTemplates(boolean useTemplates)
           
 
Methods inherited from class org.mule.routing.outbound.AbstractOutboundRouter
cloneMessage, createEventToRoute, dispose, getEnableCorrelation, getMuleContext, getOwnedMessageProcessors, getReplyTo, getResultsHandler, getRoute, getRouterStatistics, getRoutes, getTransactionConfig, isDynamicRoutes, process, propagateMagicProperties, removeRoute, sendRequest, sendRequestEvent, setEnableCorrelation, setEnableCorrelationAsString, setMessageProcessors, setMessageProperties, setReplyTo, setResultsHandler, setRouterStatistics, setRoutes, setTransactionConfig, start, stop
 
Methods inherited from class org.mule.processor.AbstractMessageProcessorOwner
getAnnotation, getAnnotations, getOwnedObjects, setAnnotations
 
Methods inherited from class org.mule.processor.AbstractMuleObjectOwner
getFlowConstruct, setFlowConstruct, setMuleContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mule.api.context.MuleContextAware
setMuleContext
 
Methods inherited from interface org.mule.api.construct.FlowConstructAware
setFlowConstruct
 

Field Detail

expressionManager

protected ExpressionManager expressionManager
Constructor Detail

FilteringOutboundRouter

public FilteringOutboundRouter()
Method Detail

initialise

public void initialise()
                throws InitialisationException
Description copied from interface: Initialisable
Method used to perform any initialisation work. If a fatal error occurs during initialisation an InitialisationException should be thrown, causing the Mule instance to shutdown. If the error is recoverable, say by retrying to connect, a RecoverableException should be thrown. There is no guarantee that by throwing a Recoverable exception that the Mule instance will not shut down.

Specified by:
initialise in interface Initialisable
Overrides:
initialise in class AbstractOutboundRouter
Throws:
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered from

route

public MuleEvent route(MuleEvent event)
                throws RoutingException
Specified by:
route in class AbstractOutboundRouter
Throws:
RoutingException

getFilter

public Filter getFilter()

setFilter

public void setFilter(Filter filter)

isMatch

public boolean isMatch(MuleMessage message)
                throws MuleException
Description copied from interface: Matchable
Determines if the event should be processed

Specified by:
isMatch in interface Matchable
Parameters:
message - the current message to evaluate
Returns:
true if the event should be processed by this router
Throws:
MuleException - if the event cannot be evaluated

getTransformers

public List<Transformer> getTransformers()

setTransformers

public void setTransformers(List<Transformer> transformers)

addRoute

public void addRoute(MessageProcessor target)
              throws MuleException
Description copied from interface: MessageRouter
Adds a new message processor to the list of routes

Specified by:
addRoute in interface MessageRouter
Overrides:
addRoute in class AbstractOutboundRouter
Parameters:
target - new destination message processor
Throws:
MuleException

getRoute

public MessageProcessor getRoute(int index,
                                 MuleEvent event)
                          throws CouldNotRouteOutboundMessageException
Will Return the target at the given index and will resolve any template tags on the Endpoint URI if necessary

Parameters:
index - the index of the endpoint to get
event - the current event. This is required if template matching is being used
Returns:
the endpoint at the index, with any template tags resolved
Throws:
CouldNotRouteOutboundMessageException - if the template causs the endpoint to become illegal or malformed

isUseTemplates

public boolean isUseTemplates()

setUseTemplates

public void setUseTemplates(boolean useTemplates)

isTransformBeforeMatch

public boolean isTransformBeforeMatch()
Specified by:
isTransformBeforeMatch in interface TransformingMatchable


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