public abstract class AbstractOutboundRouter extends AbstractMessageProcessorOwner implements OutboundRouter
AbstractOutboundRouter is a base router class that tracks statistics about message processing through the router.ReactiveProcessor.ProcessingType| Modifier and Type | Field and Description |
|---|---|
protected AtomicBoolean |
initialised |
protected org.slf4j.Logger |
logger
logger used by this class
|
protected RouterResultsHandler |
resultsHandler |
protected List<Processor> |
routes |
protected AtomicBoolean |
started |
protected TransactionConfig |
transactionConfig |
flowConstruct, messagingExceptionHandler, muleContext| Constructor and Description |
|---|
AbstractOutboundRouter() |
| Modifier and Type | Method and Description |
|---|---|
void |
addRoute(Processor route)
Adds a new message processor to the list of routes
|
protected Event |
createEventToRoute(Event routedEvent,
org.mule.runtime.api.message.Message message)
Create a new event to be routed to the target MP
|
void |
dispose() |
protected Event |
doProcessRoute(Processor route,
Event event) |
MuleContext |
getMuleContext() |
protected List<Processor> |
getOwnedMessageProcessors() |
RouterResultsHandler |
getResultsHandler() |
RouterStatistics |
getRouterStatistics() |
List<Processor> |
getRoutes()
Gets a list of MessageProcessor instances associated with this router
|
TransactionConfig |
getTransactionConfig() |
void |
initialise() |
boolean |
isDynamicRoutes()
Determines whether this router supports dynamic route.
|
Event |
process(Event event)
Invokes the MessageProcessor.
|
void |
removeRoute(Processor route)
Removes a message processor from the list of routes
|
protected abstract Event |
route(Event event) |
protected Event |
sendRequest(Event originalEvent,
Event eventToRoute,
Processor route,
boolean awaitResponse) |
protected Event |
sendRequestEvent(Event originalEvent,
Event eventToRoute,
Processor route,
boolean awaitResponse)
Send message event to destination.
|
void |
setFlowConstruct(FlowConstruct flowConstruct) |
void |
setMessageProcessors(List<Processor> routes)
Deprecated.
|
void |
setMuleContext(MuleContext context) |
void |
setResultsHandler(RouterResultsHandler resultsHandler) |
void |
setRouterStatistics(RouterStatistics stats) |
void |
setRoutes(List<Processor> routes) |
void |
setTransactionConfig(TransactionConfig transactionConfig) |
void |
start() |
void |
stop() |
getOwnedObjectsgetFlowConstruct, setMessagingExceptionHandlergetAnnotation, getAnnotations, getLocation, setAnnotationsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetProcessingTypeprotected transient org.slf4j.Logger logger
protected TransactionConfig transactionConfig
protected RouterResultsHandler resultsHandler
protected AtomicBoolean initialised
protected AtomicBoolean started
public Event process(Event event) throws org.mule.runtime.api.exception.MuleException
Processorprotected abstract Event route(Event event) throws org.mule.runtime.api.exception.MuleException
org.mule.runtime.api.exception.MuleExceptionprotected final Event sendRequest(Event originalEvent, Event eventToRoute, Processor route, boolean awaitResponse) throws org.mule.runtime.api.exception.MuleException
org.mule.runtime.api.exception.MuleExceptionpublic List<Processor> getRoutes()
OutboundRoutergetRoutes in interface OutboundRouter@Deprecated public void setMessageProcessors(List<Processor> routes) throws org.mule.runtime.api.exception.MuleException
org.mule.runtime.api.exception.MuleExceptionpublic void setRoutes(List<Processor> routes) throws org.mule.runtime.api.exception.MuleException
org.mule.runtime.api.exception.MuleExceptionpublic void addRoute(Processor route) throws org.mule.runtime.api.exception.MuleException
MessageRouteraddRoute in interface MessageRouterroute - new destination message processororg.mule.runtime.api.exception.MuleExceptionpublic void removeRoute(Processor route) throws org.mule.runtime.api.exception.MuleException
MessageRouterremoveRoute in interface MessageRouterroute - destination message processor to removeorg.mule.runtime.api.exception.MuleExceptionpublic TransactionConfig getTransactionConfig()
public void setTransactionConfig(TransactionConfig transactionConfig)
setTransactionConfig in interface OutboundRouterpublic boolean isDynamicRoutes()
OutboundRouterisDynamicRoutes in interface OutboundRouterpublic RouterResultsHandler getResultsHandler()
public void setResultsHandler(RouterResultsHandler resultsHandler)
protected Event sendRequestEvent(Event originalEvent, Event eventToRoute, Processor route, boolean awaitResponse) throws org.mule.runtime.api.exception.MuleException
org.mule.runtime.api.exception.MuleExceptionprotected Event doProcessRoute(Processor route, Event event) throws org.mule.runtime.api.exception.MuleException, MessagingException
org.mule.runtime.api.exception.MuleExceptionMessagingExceptionprotected Event createEventToRoute(Event routedEvent, org.mule.runtime.api.message.Message message)
public void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableinitialise in class AbstractMuleObjectOwner<Processor>org.mule.runtime.api.lifecycle.InitialisationExceptionpublic void dispose()
dispose in interface org.mule.runtime.api.lifecycle.Disposabledispose in class AbstractMuleObjectOwner<Processor>public void start()
throws org.mule.runtime.api.exception.MuleException
start in interface org.mule.runtime.api.lifecycle.Startablestart in class AbstractMuleObjectOwner<Processor>org.mule.runtime.api.exception.MuleExceptionpublic void stop()
throws org.mule.runtime.api.exception.MuleException
stop in interface org.mule.runtime.api.lifecycle.Stoppablestop in class AbstractMuleObjectOwner<Processor>org.mule.runtime.api.exception.MuleExceptionpublic MuleContext getMuleContext()
getMuleContext in class AbstractMuleObjectOwner<Processor>public void setRouterStatistics(RouterStatistics stats)
setRouterStatistics in interface RouterStatisticsRecorderpublic RouterStatistics getRouterStatistics()
protected List<Processor> getOwnedMessageProcessors()
getOwnedMessageProcessors in class AbstractMessageProcessorOwnerpublic void setMuleContext(MuleContext context)
setMuleContext in interface MuleContextAwaresetMuleContext in class AbstractMuleObjectOwner<Processor>context - the Mule node.public void setFlowConstruct(FlowConstruct flowConstruct)
setFlowConstruct in interface FlowConstructAwaresetFlowConstruct in class AbstractMuleObjectOwner<Processor>Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.