org.mule.routing.outbound
Class AbstractMessageSequenceSplitter

java.lang.Object
  extended by org.mule.processor.AbstractInterceptingMessageProcessorBase
      extended by org.mule.processor.AbstractInterceptingMessageProcessor
          extended by org.mule.routing.outbound.AbstractMessageSequenceSplitter
All Implemented Interfaces:
AnnotatedObject, MuleContextAware, InterceptingMessageProcessor, MessageProcessor, MessageProcessorContainer, MessageSource
Direct Known Subclasses:
AbstractSplitter, CollectionSplitter

public abstract class AbstractMessageSequenceSplitter
extends AbstractInterceptingMessageProcessor
implements MuleContextAware

Base implementation of a MuleMessage splitter, that converts its payload in a MessageSequence, and process each element of it. Implementations must implement splitMessageIntoSequence(MuleEvent) and determine how the message is split.

EIP Reference: http://www .eaipatterns.com/Sequencer.html

Author:
flbulgarelli
See Also:
AbstractSplitter

Field Summary
protected  int batchSize
           
protected  String counterVariableName
           
protected  CorrelationMode enableCorrelation
           
protected  MessageInfoMapping messageInfoMapping
           
protected  MuleContext muleContext
           
protected  RouterResultsHandler resultsHandler
           
 
Fields inherited from class org.mule.processor.AbstractInterceptingMessageProcessorBase
logger, next, notificationHandler
 
Fields inherited from interface org.mule.api.AnnotatedObject
PROPERTY_NAME
 
Constructor Summary
AbstractMessageSequenceSplitter()
           
 
Method Summary
protected  boolean isSplitRequired(MuleEvent event)
           
 MuleEvent process(MuleEvent event)
          Invokes the MessageProcessor.
protected  List<MuleEvent> processParts(MessageSequence<?> seq, MuleEvent originalEvent)
           
 void setBatchSize(int batchSize)
          Split the elements in groups of the specified size
 void setCounterVariableName(String counterVariableName)
           
 void setEnableCorrelation(CorrelationMode enableCorrelation)
           
 void setMessageInfoMapping(MessageInfoMapping messageInfoMapping)
           
 void setMuleContext(MuleContext context)
           
protected abstract  MessageSequence<?> splitMessageIntoSequence(MuleEvent event)
          Converts the event into a MessageSequence that will retrieve each of the event elements
 
Methods inherited from class org.mule.processor.AbstractInterceptingMessageProcessorBase
addMessageProcessorPathElements, getAnnotation, getAnnotations, getListener, getMuleContext, isEventValid, processNext, setAnnotations, setListener, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.api.source.MessageSource
setListener
 

Field Detail

muleContext

protected MuleContext muleContext

resultsHandler

protected RouterResultsHandler resultsHandler

enableCorrelation

protected CorrelationMode enableCorrelation

messageInfoMapping

protected MessageInfoMapping messageInfoMapping

batchSize

protected int batchSize

counterVariableName

protected String counterVariableName
Constructor Detail

AbstractMessageSequenceSplitter

public AbstractMessageSequenceSplitter()
Method Detail

process

public final 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

isSplitRequired

protected boolean isSplitRequired(MuleEvent event)

splitMessageIntoSequence

protected abstract MessageSequence<?> splitMessageIntoSequence(MuleEvent event)
                                                        throws MuleException
Converts the event into a MessageSequence that will retrieve each of the event elements

Parameters:
event - the event to split
Returns:
a sequence of elements
Throws:
MuleException

processParts

protected List<MuleEvent> processParts(MessageSequence<?> seq,
                                       MuleEvent originalEvent)
                                throws MuleException
Throws:
MuleException

setEnableCorrelation

public void setEnableCorrelation(CorrelationMode enableCorrelation)

setMuleContext

public void setMuleContext(MuleContext context)
Specified by:
setMuleContext in interface MuleContextAware
Overrides:
setMuleContext in class AbstractInterceptingMessageProcessorBase

setMessageInfoMapping

public void setMessageInfoMapping(MessageInfoMapping messageInfoMapping)

setBatchSize

public void setBatchSize(int batchSize)
Split the elements in groups of the specified size


setCounterVariableName

public void setCounterVariableName(String counterVariableName)


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