|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.processor.AbstractMuleObjectOwner<MessageProcessor>
org.mule.processor.AbstractMessageProcessorOwner
org.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 AtomicBoolean |
initialised
|
protected Log |
logger
logger used by this class |
protected static List<String> |
magicProperties
These properties are automatically propagated by Mule from inbound to outbound |
protected String |
replyTo
|
protected RouterResultsHandler |
resultsHandler
|
protected List<MessageProcessor> |
routes
|
protected AtomicBoolean |
started
|
protected TransactionConfig |
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 | |
---|---|
AbstractOutboundRouter()
|
Method Summary | |
---|---|
void |
addRoute(MessageProcessor route)
Adds a new message processor to the list of routes |
protected MuleMessage |
cloneMessage(MuleMessage message)
Create a fresh copy of a message. |
protected MuleEvent |
createEventToRoute(MuleEvent routedEvent,
MuleMessage message,
MessageProcessor route)
Create a new event to be routed to the target MP |
void |
dispose()
A lifecycle method where implementor should free up any resources. |
CorrelationMode |
getEnableCorrelation()
|
MuleContext |
getMuleContext()
|
protected List<MessageProcessor> |
getOwnedMessageProcessors()
|
String |
getReplyTo()
|
RouterResultsHandler |
getResultsHandler()
|
MessageProcessor |
getRoute(String name)
|
RouterStatistics |
getRouterStatistics()
|
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(String enableCorrelation)
|
void |
setMessageProcessors(List<MessageProcessor> routes)
Deprecated. |
protected void |
setMessageProperties(FlowConstruct service,
MuleMessage message,
MessageProcessor route)
|
void |
setReplyTo(String replyTo)
Sets the replyTo route for any outgoing messages. |
void |
setResultsHandler(RouterResultsHandler resultsHandler)
|
void |
setRouterStatistics(RouterStatistics stats)
|
void |
setRoutes(List<MessageProcessor> routes)
|
void |
setTransactionConfig(TransactionConfig transactionConfig)
|
void |
start()
|
void |
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.routing.Matchable |
---|
isMatch |
Methods inherited from interface org.mule.api.context.MuleContextAware |
---|
setMuleContext |
Methods inherited from interface org.mule.api.construct.FlowConstructAware |
---|
setFlowConstruct |
Field Detail |
---|
protected static List<String> magicProperties
protected transient Log logger
protected List<MessageProcessor> routes
protected String replyTo
protected CorrelationMode enableCorrelation
protected TransactionConfig transactionConfig
protected RouterResultsHandler resultsHandler
protected AtomicBoolean initialised
protected 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 List<MessageProcessor> getRoutes()
OutboundRouter
getRoutes
in interface OutboundRouter
@Deprecated public void setMessageProcessors(List<MessageProcessor> routes) throws MuleException
MuleException
public void setRoutes(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 String getReplyTo()
public void setReplyTo(String replyTo)
OutboundRouter
setReplyTo
in interface OutboundRouter
replyTo
- route string to usepublic CorrelationMode getEnableCorrelation()
public void setEnableCorrelation(CorrelationMode enableCorrelation)
public void setEnableCorrelationAsString(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(String name)
name
- the route identifier
public RouterResultsHandler getResultsHandler()
public void setResultsHandler(RouterResultsHandler resultsHandler)
protected MuleEvent sendRequestEvent(MuleEvent routedEvent, MuleMessage message, MessageProcessor route, boolean awaitResponse) throws MuleException
MuleException
protected MuleEvent createEventToRoute(MuleEvent routedEvent, MuleMessage message, MessageProcessor route)
protected MuleMessage cloneMessage(MuleMessage message)
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
initialise
in class AbstractMuleObjectOwner<MessageProcessor>
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
dispose
in class AbstractMuleObjectOwner<MessageProcessor>
public void start() throws MuleException
start
in interface Startable
start
in class AbstractMuleObjectOwner<MessageProcessor>
MuleException
public void stop() throws MuleException
stop
in interface Stoppable
stop
in class AbstractMuleObjectOwner<MessageProcessor>
MuleException
public MuleContext getMuleContext()
getMuleContext
in class AbstractMuleObjectOwner<MessageProcessor>
public void setRouterStatistics(RouterStatistics stats)
setRouterStatistics
in interface RouterStatisticsRecorder
public RouterStatistics getRouterStatistics()
protected List<MessageProcessor> getOwnedMessageProcessors()
getOwnedMessageProcessors
in class AbstractMessageProcessorOwner
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |