Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.routing.outbound
Class AbstractOutboundRouter

    java.lang.Object
      org.mule.routing.outbound.AbstractOutboundRouter

All Implemented Interfaces:
  FlowConstructAware, MuleContextAware, Disposable, Initialisable, Lifecycle, Startable, Stoppable, MessageProcessor, MessageRouter, Matchable, MatchableMessageProcessor, MatchableMessageRouter, OutboundRouter, RouterStatisticsRecorder

Direct Known Subclasses:
  ContentBasedRouter, FilteringOutboundRouter, TransformerRouter

    public abstract class AbstractOutboundRouter

extends Object
implements OutboundRouter

`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 List<String>` | `magicProperties` These properties are automatically propagated by Mule from inbound to outbound
`protected MuleContext` | `muleContext`
`protected String` | `replyTo`
`protected RouterResultsHandler` | `resultsHandler`
`protected 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()`
`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` | `setFlowConstruct(FlowConstruct flowConstruct)`
`void` | `setMessageProcessors(List<MessageProcessor> routes)` Deprecated.
`protected void` | `setMessageProperties(FlowConstruct service, MuleMessage message, MessageProcessor route)`
`void` | `setMuleContext(MuleContext context)`
`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 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

### magicProperties

    protected static List<String> magicProperties

  These properties are automatically propagated by Mule from inbound to outbound

### logger

    protected transient Log logger

  logger used by this class

### routes

    protected List<MessageProcessor> routes

### replyTo

    protected String replyTo

### enableCorrelation

    protected CorrelationMode enableCorrelation

  Determines if Mule stamps outgoing message with a correlation ID or not.

### transactionConfig

    protected TransactionConfig transactionConfig

### resultsHandler

    protected RouterResultsHandler resultsHandler

### muleContext

    protected MuleContext muleContext

### flowConstruct

    protected FlowConstruct flowConstruct

### initialised

    protected edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean initialised

### started

    protected edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean started

Constructor Detail

### AbstractOutboundRouter

    public AbstractOutboundRouter()

Method Detail

### process

    public MuleEvent process(MuleEvent event)
                      throws MuleException

  Description copied from interface: `MessageProcessor`
  Invokes the MessageProcessor.

  Specified by:
    `process` in interface `MessageProcessor`
  Parameters:
    `event` - MuleEvent to be processed
  Returns:
    optional response MuleEvent
  Throws:
    `MuleException`

### route

    protected abstract MuleEvent route(MuleEvent event)
                                throws MessagingException

  Throws:
    `MessagingException`

### sendRequest

    protected final MuleEvent sendRequest(MuleEvent routedEvent,
                                          MuleMessage message,
                                          MessageProcessor route,
                                          boolean awaitResponse)
                                   throws MuleException

  Throws:
    `MuleException`

### setMessageProperties

    protected void setMessageProperties(FlowConstruct service,
                                        MuleMessage message,
                                        MessageProcessor route)

### getRoutes

    public List<MessageProcessor> getRoutes()

  Description copied from interface: `OutboundRouter`
  Gets a list of MessageProcessor instances associated with this router

  Specified by:
    `getRoutes` in interface `OutboundRouter`
  Returns:
    a list of MessageProcessor instances

### setMessageProcessors

    @Deprecated
    public void setMessageProcessors(List<MessageProcessor> routes)
                              throws MuleException

  Deprecated.

  Throws:
    `MuleException`

### setRoutes

    public void setRoutes(List<MessageProcessor> routes)
                   throws MuleException

  Throws:
    `MuleException`

### addRoute

    public void addRoute(MessageProcessor route)
                  throws MuleException

  Description copied from interface: `MessageRouter`
  Adds a new message processor to the list of routes

  Specified by:
    `addRoute` in interface `MessageRouter`
  Parameters:
    `route` - new destination message processor
  Throws:
    `MuleException`

### removeRoute

    public void removeRoute(MessageProcessor route)
                     throws MuleException

  Description copied from interface: `MessageRouter`
  Removes a message processor from the list of routes

  Specified by:
    `removeRoute` in interface `MessageRouter`
  Parameters:
    `route` - destination message processor to remove
  Throws:
    `MuleException`

### getReplyTo

    public String getReplyTo()

### setReplyTo

    public void setReplyTo(String replyTo)

  Description copied from interface: `OutboundRouter`
  Sets the replyTo route for any outgoing messages. This will then be used by other Mule routers to send replies back for this message. If the underlying protocol supports replyTo messages, such as Jms, a Jms Destination will be attached to the outbound message

  Specified by:
    `setReplyTo` in interface `OutboundRouter`
  Parameters:
    `replyTo` - route string to use

### getEnableCorrelation

    public CorrelationMode getEnableCorrelation()

### setEnableCorrelation

    public void setEnableCorrelation(CorrelationMode enableCorrelation)

### setEnableCorrelationAsString

    public void setEnableCorrelationAsString(String enableCorrelation)

### getTransactionConfig

    public TransactionConfig getTransactionConfig()

### setTransactionConfig

    public void setTransactionConfig(TransactionConfig transactionConfig)

  Specified by:
    `setTransactionConfig` in interface `OutboundRouter`

### isDynamicRoutes

    public boolean isDynamicRoutes()

  Description copied from interface: `OutboundRouter`
  Determines whether this router supports dynamic route. i.e. routes that are not configured at design time. routes might be pulled from the message or payload.

  Specified by:
    `isDynamicRoutes` in interface `OutboundRouter`

### getRoute

    public MessageProcessor getRoute(String name)

  Parameters:
    `name` - the route identifier
  Returns:
    the route or null if the endpoint's Uri is not registered
  See Also:
    `org.mule.api.routing.InboundRouterCollection`

### getResultsHandler

    public RouterResultsHandler getResultsHandler()

### setResultsHandler

    public void setResultsHandler(RouterResultsHandler resultsHandler)

### sendRequestEvent

    protected MuleEvent sendRequestEvent(MuleEvent routedEvent,
                                         MuleMessage message,
                                         MessageProcessor route,
                                         boolean awaitResponse)
                                  throws MuleException

  Send message event to destination.

  Throws:
    `MuleException`

### propagateMagicProperties

    protected void propagateMagicProperties(MuleMessage in,
                                            MuleMessage out)

  Propagates a number of internal system properties to handle correlation, session, etc. Note that in and out params can be the same message object when not dealing with replies.

  See Also:
    `magicProperties`

### 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`
  Throws:
    `InitialisationException` - if a fatal error occurs causing the Mule instance to shutdown
    `RecoverableException` - if an error occurs that can be recovered from

### dispose

    public void dispose()

  Description copied from interface: `Disposable`
  A lifecycle method where implementor should free up any resources. If an exception is thrown it should just be logged and processing should continue. This method should not throw Runtime exceptions.

  Specified by:
    `dispose` in interface `Disposable`

### start

    public void start()
               throws MuleException

  Specified by:
    `start` in interface `Startable`
  Throws:
    `MuleException`

### stop

    public void stop()
              throws MuleException

  Specified by:
    `stop` in interface `Stoppable`
  Throws:
    `MuleException`

### setMuleContext

    public void setMuleContext(MuleContext context)

  Specified by:
    `setMuleContext` in interface `MuleContextAware`

### setFlowConstruct

    public void setFlowConstruct(FlowConstruct flowConstruct)

  Specified by:
    `setFlowConstruct` in interface `FlowConstructAware`

### getMuleContext

    public MuleContext getMuleContext()

### setRouterStatistics

    public void setRouterStatistics(RouterStatistics stats)

  Specified by:
    `setRouterStatistics` in interface `RouterStatisticsRecorder`

### getRouterStatistics

    public RouterStatistics getRouterStatistics()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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