AbstractRoundRobinMessageSplitter (Mule ESB 2.2.1 API)
Keywords: org.mule.routing.outbound.AbstractRoundRobinMessageSplitter class

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 AbstractRoundRobinMessageSplitter

    java.lang.Object
      org.mule.routing.AbstractRouter
          org.mule.routing.outbound.AbstractOutboundRouter
              org.mule.routing.outbound.FilteringOutboundRouter
                  org.mule.routing.outbound.AbstractMessageSplitter
                      org.mule.routing.outbound.AbstractRoundRobinMessageSplitter

All Implemented Interfaces:
  MuleContextAware, Disposable, Initialisable, OutboundRouter, Router

Direct Known Subclasses:
  ExpressionMessageSplitter, ListMessageSplitter, XmlMessageSplitter

    public class AbstractRoundRobinMessageSplitter

extends AbstractMessageSplitter

`FilteringListMessageSplitter` accepts a List as a message payload then routes list elements as messages over an endpoint where the endpoint's filter accepts the payload.

Field Summary

Fields inherited from class org.mule.routing.outbound.FilteringOutboundRouter
`expressionManager`

Fields inherited from class org.mule.routing.outbound.AbstractOutboundRouter
`ENABLE_CORRELATION_ALWAYS, ENABLE_CORRELATION_IF_NOT_SET, ENABLE_CORRELATION_NEVER, enableCorrelation, endpoints, logger, messageInfoMapping, replyTo, resultsHandler, transactionConfig`

Fields inherited from class org.mule.routing.AbstractRouter
`muleContext`

Fields inherited from interface org.mule.api.lifecycle.Initialisable
`PHASE_NAME`

Fields inherited from interface org.mule.api.lifecycle.Disposable
`PHASE_NAME`

Constructor Summary
`AbstractRoundRobinMessageSplitter()`

Method Summary
`protected SplitMessage` | `getMessageParts(MuleMessage message, List endpoints)` Retrieves a specific message part for the given endpoint.
`void` | `initialise()` Method used to perform any initialisation work.
`boolean` | `isDeterministic()` If this option is true (the default) then the first message part is routed to the first endpoint, the second part to the second endpoint, etc, with the nth part going to the (n modulo number of endpoints) endpoint.
`boolean` | `isDisableRoundRobin()` The default behaviour for splitter routers is to round-robin across endpoints.
`boolean` | `isFailIfNoMatch()` If none of the endpoints match a split message part i.e.
`void` | `setDeterministic(boolean deterministic)` If this option is true (the default) then the first message part is routed to the first endpoint, the second part to the second endpoint, etc, with the nth part going to the (n modulo number of endpoints) endpoint.
`void` | `setDisableRoundRobin(boolean disableRoundRobin)` The default behaviour for splitter routers is to round-robin across endpoints.
`void` | `setFailIfNoMatch(boolean failIfNoMatch)` If none of the endpoints match a split message part i.e.
`protected List` | `splitMessage(MuleMessage message)` Method used just to split the message into parts.

Methods inherited from class org.mule.routing.outbound.AbstractMessageSplitter
`route`

Methods inherited from class org.mule.routing.outbound.FilteringOutboundRouter
`addEndpoint, getEndpoint, getFilter, getTransformers, isMatch, isRequiresNewMessage, isUseTemplates, setFilter, setTransformers, setUseTemplates`

Methods inherited from class org.mule.routing.outbound.AbstractOutboundRouter
`createTransactionTemplate, dispatch, getEnableCorrelation, getEndpoint, getEndpoints, getMessageInfoMapping, getReplyTo, getResultsHandler, getTransactionConfig, isDynamicEndpoints, removeEndpoint, send, setEnableCorrelation, setEnableCorrelationAsString, setEndpoints, setMessageInfoMapping, setMessageProperties, setReplyTo, setResultsHandler, setTransactionConfig`

Methods inherited from class org.mule.routing.AbstractRouter
`dispose, getMuleContext, getRouterStatistics, setMuleContext, setRouterStatistics`

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.Router
`getRouterStatistics, setRouterStatistics`

Methods inherited from interface org.mule.api.lifecycle.Disposable
`dispose`

Constructor Detail

### AbstractRoundRobinMessageSplitter

    public AbstractRoundRobinMessageSplitter()

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

### splitMessage

    protected List splitMessage(MuleMessage message)

  Method used just to split the message into parts. Each part should be an entry in the list. The list can contain either `MuleMessage` objects or just payloads (Mule will automatically convert the payloads into messages).

  This method can be overridden by custom implementations of splitter router where the distribution of the message parts will be done using either round robin or endpoint filtering.

  Parameters:
    `message` - the source message to split into parts
  Returns:
    a list of payload objects or `MuleMessage` objects. Usually, it is sufficient just to return payload objects

### getMessageParts

    protected SplitMessage getMessageParts(MuleMessage message,
                                           List endpoints)

  Retrieves a specific message part for the given endpoint. the message will then be routed via the provider.

  NOTE:Implementations must provide proper synchronization for shared state (payload, properties, etc.)

  Specified by:
    `getMessageParts` in class `AbstractMessageSplitter`
  Parameters:
    `message` - the current message being processed
    `endpoints` - A list of endpoints that will be used to dispatch each of the parts
  Returns:
    a `List` of message parts. Each part will become the payload of the outgoing message. Note that the parts will be dispatched to
  See Also:
    `SplitMessage`, `AbstractRoundRobinMessageSplitter`

### isDeterministic

    public boolean isDeterministic()

  If this option is true (the default) then the first message part is routed to the first endpoint, the second part to the second endpoint, etc, with the nth part going to the (n modulo number of endpoints) endpoint. If false then the messages will be distributed equally amongst all endpoints.

  The behaviour changes if the endpoints have filters since the message part will get routed based on the next endpoint that follows the above rule AND passes the endpoint filter.

  Returns:
    true if deterministic has been set to true

### setDeterministic

    public void setDeterministic(boolean deterministic)

  If this option is true (the default) then the first message part is routed to the first endpoint, the second part to the second endpoint, etc, with the nth part going to the (n modulo number of endpoints) endpoint. If false then the messages will be distributed equally amongst all endpoints.

  The behaviour changes if the endpoints have filters since the message part will get routed based on the next endpoint that follows the above rule AND passes the endpoint filter.

  Parameters:
    `deterministic` - the value to set

### isDisableRoundRobin

    public boolean isDisableRoundRobin()

  The default behaviour for splitter routers is to round-robin across endpoints. When using filters on endpoints it is sometimes desirable to use only the filters to control which endpoint the split message part goes too. For example, if you have 3 endpoints where two have a filter but the last does not, you'll need to disable round robin since the 3rd endpoint may end up routing a message that one of the other endpoints should have routed. Generally it is good practice to either configure all endpoints with filters or none, in this case there is not need to set this property.

  Returns:
    true if disabled

### setDisableRoundRobin

    public void setDisableRoundRobin(boolean disableRoundRobin)

  The default behaviour for splitter routers is to round-robin across endpoints. When using filters on endpoints it is sometimes desirable to use only the filters to control which endpoint the split message part goes too. For example, if you have 3 endpoints where two have a filter but the last does not, you'll need to disable round robin since the 3rd endpoint may end up routing a message that one of the other endpoints should have routed. Generally it is good practice to either configure all endpoints with filters or none, in this case there is not need to set this property.

  Parameters:
    `disableRoundRobin` - true if disabled

### isFailIfNoMatch

    public boolean isFailIfNoMatch()

  If none of the endpoints match a split message part i.e. each endpoint has a filter for a certain message part. This flag controls whether the part is ignorred or an exceptin is thrown.

  Returns:
    true if an exception should be thrown when no match is found

### setFailIfNoMatch

    public void setFailIfNoMatch(boolean failIfNoMatch)

  If none of the endpoints match a split message part i.e. each endpoint has a filter for a certain message part. This flag controls whether the part is ignorred or an exceptin is thrown.

  Parameters:
    `failIfNoMatch` - true if an exception should be thrown when no match is found

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-2009 MuleSource, Inc.. All Rights Reserved.