|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.routing.outbound.AbstractOutboundRouter
public abstract class AbstractOutboundRouter
AbstractOutboundRouter
is a base router class that tracks statistics about message processing
through the router.
Field Summary | |
---|---|
protected CorrelationMode |
enableCorrelation
Determines if Mule stamps outgoing message with a correlation ID or not. |
protected FlowConstruct |
flowConstruct
|
protected edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean |
initialised
|
protected Log |
logger
logger used by this class |
protected static java.util.List<java.lang.String> |
magicProperties
These properties are automatically propagated by Mule from inbound to outbound |
protected MuleContext |
muleContext
|
protected java.lang.String |
replyTo
|
protected RouterResultsHandler |
resultsHandler
|
protected java.util.List<MessageProcessor> |
routes
|
protected edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean |
started
|
protected TransactionConfig |
transactionConfig
|
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 |
Constructor Summary | |
---|---|
AbstractOutboundRouter()
|
Method Summary | |
---|---|
void |
addRoute(MessageProcessor route)
Adds a new message processor to the list of routes |
void |
dispose()
A lifecycle method where implementor should free up any resources. |
CorrelationMode |
getEnableCorrelation()
|
MuleContext |
getMuleContext()
|
java.lang.String |
getReplyTo()
|
RouterResultsHandler |
getResultsHandler()
|
MessageProcessor |
getRoute(java.lang.String name)
|
RouterStatistics |
getRouterStatistics()
|
java.util.List<MessageProcessor> |
getRoutes()
Gets a list of MessageProcessor instances associated with this router |
TransactionConfig |
getTransactionConfig()
|
void |
initialise()
Method used to perform any initialisation work. |
boolean |
isDynamicRoutes()
Determines whether this router supports dynamic route. |
MuleEvent |
process(MuleEvent event)
Invokes the MessageProcessor. |
protected void |
propagateMagicProperties(MuleMessage in,
MuleMessage out)
Propagates a number of internal system properties to handle correlation, session, etc. |
void |
removeRoute(MessageProcessor route)
Removes a message processor from the list of routes |
protected abstract MuleEvent |
route(MuleEvent event)
|
protected MuleEvent |
sendRequest(MuleEvent routedEvent,
MuleMessage message,
MessageProcessor route,
boolean awaitResponse)
|
protected MuleEvent |
sendRequestEvent(MuleEvent routedEvent,
MuleMessage message,
MessageProcessor route,
boolean awaitResponse)
Send message event to destination. |
void |
setEnableCorrelation(CorrelationMode enableCorrelation)
|
void |
setEnableCorrelationAsString(java.lang.String enableCorrelation)
|
void |
setFlowConstruct(FlowConstruct flowConstruct)
|
void |
setMessageProcessors(java.util.List<MessageProcessor> routes)
Deprecated. |
protected void |
setMessageProperties(FlowConstruct service,
MuleMessage message,
MessageProcessor route)
|
void |
setMuleContext(MuleContext context)
|
void |
setReplyTo(java.lang.String replyTo)
Sets the replyTo route for any outgoing messages. |
void |
setResultsHandler(RouterResultsHandler resultsHandler)
|
void |
setRouterStatistics(RouterStatistics stats)
|
void |
setRoutes(java.util.List<MessageProcessor> routes)
|
void |
setTransactionConfig(TransactionConfig transactionConfig)
|
void |
start()
|
void |
stop()
|
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.routing.Matchable |
---|
isMatch |
Field Detail |
---|
protected static java.util.List<java.lang.String> magicProperties
protected transient Log logger
protected java.util.List<MessageProcessor> routes
protected java.lang.String replyTo
protected CorrelationMode enableCorrelation
protected TransactionConfig transactionConfig
protected RouterResultsHandler resultsHandler
protected MuleContext muleContext
protected FlowConstruct flowConstruct
protected edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean initialised
protected edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean started
Constructor Detail |
---|
public AbstractOutboundRouter()
Method Detail |
---|
public MuleEvent process(MuleEvent event) throws MuleException
MessageProcessor
process
in interface MessageProcessor
event
- MuleEvent to be processed
MuleException
protected abstract MuleEvent route(MuleEvent event) throws MessagingException
MessagingException
protected final MuleEvent sendRequest(MuleEvent routedEvent, MuleMessage message, MessageProcessor route, boolean awaitResponse) throws MuleException
MuleException
protected void setMessageProperties(FlowConstruct service, MuleMessage message, MessageProcessor route)
public java.util.List<MessageProcessor> getRoutes()
OutboundRouter
getRoutes
in interface OutboundRouter
@Deprecated public void setMessageProcessors(java.util.List<MessageProcessor> routes) throws MuleException
MuleException
public void setRoutes(java.util.List<MessageProcessor> routes) throws MuleException
MuleException
public void addRoute(MessageProcessor route) throws MuleException
MessageRouter
addRoute
in interface MessageRouter
route
- new destination message processor
MuleException
public void removeRoute(MessageProcessor route) throws MuleException
MessageRouter
removeRoute
in interface MessageRouter
route
- destination message processor to remove
MuleException
public java.lang.String getReplyTo()
public void setReplyTo(java.lang.String replyTo)
OutboundRouter
setReplyTo
in interface OutboundRouter
replyTo
- route string to usepublic CorrelationMode getEnableCorrelation()
public void setEnableCorrelation(CorrelationMode enableCorrelation)
public void setEnableCorrelationAsString(java.lang.String enableCorrelation)
public TransactionConfig getTransactionConfig()
public void setTransactionConfig(TransactionConfig transactionConfig)
setTransactionConfig
in interface OutboundRouter
public boolean isDynamicRoutes()
OutboundRouter
isDynamicRoutes
in interface OutboundRouter
public MessageProcessor getRoute(java.lang.String name)
name
- the route identifier
org.mule.api.routing.InboundRouterCollection
public RouterResultsHandler getResultsHandler()
public void setResultsHandler(RouterResultsHandler resultsHandler)
protected MuleEvent sendRequestEvent(MuleEvent routedEvent, MuleMessage message, MessageProcessor route, boolean awaitResponse) throws MuleException
MuleException
protected void propagateMagicProperties(MuleMessage in, MuleMessage out)
magicProperties
public void initialise() throws InitialisationException
Initialisable
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.
initialise
in interface Initialisable
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdown
RecoverableException
- if an error occurs that can be recovered frompublic void dispose()
Disposable
dispose
in interface Disposable
public void start() throws MuleException
start
in interface Startable
MuleException
public void stop() throws MuleException
stop
in interface Stoppable
MuleException
public void setMuleContext(MuleContext context)
setMuleContext
in interface MuleContextAware
public void setFlowConstruct(FlowConstruct flowConstruct)
setFlowConstruct
in interface FlowConstructAware
public MuleContext getMuleContext()
public void setRouterStatistics(RouterStatistics stats)
setRouterStatistics
in interface RouterStatisticsRecorder
public RouterStatistics getRouterStatistics()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |