org.mule.construct
Class AbstractPipeline

java.lang.Object
  extended by org.mule.construct.AbstractFlowConstruct
      extended by org.mule.construct.AbstractPipeline
All Implemented Interfaces:
AnnotatedObject, FlowConstruct, MessageProcessorPathResolver, Pipeline, Disposable, Initialisable, Lifecycle, LifecycleStateEnabled, Startable, Stoppable, NamedObject, MessageProcessorContainer, ProcessingDescriptor
Direct Known Subclasses:
AbstractConfigurationPattern, Flow

public abstract class AbstractPipeline
extends AbstractFlowConstruct
implements Pipeline

Abstract implementation of AbstractFlowConstruct that allows a list of AbstractPipeline.ProcessIfPipelineStartedMessageProcessors that will be used to process messages to be configured. These MessageProcessors are chained together using the DefaultMessageProcessorChainBuilder.

If no message processors are configured then the source message is simply returned.


Nested Class Summary
 class AbstractPipeline.ProcessIfPipelineStartedMessageProcessor
           
 
Field Summary
protected  List<MessageProcessor> messageProcessors
           
protected  MessageSource messageSource
           
protected  MessageProcessor pipeline
           
protected  ProcessingStrategy processingStrategy
           
 
Fields inherited from class org.mule.construct.AbstractFlowConstruct
exceptionListener, INITIAL_STATE_STARTED, INITIAL_STATE_STOPPED, initialState, lifecycleManager, logger, messageInfoMapping, muleContext, name, statistics
 
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
AbstractPipeline(String name, MuleContext muleContext)
           
 
Method Summary
 void addMessageProcessorPathElements(MessageProcessorPathElement pathElement)
          Add the child nodes to the path element tree.
protected  void configureMessageProcessors(MessageProcessorChainBuilder builder)
           
protected  void configurePostProcessors(MessageProcessorChainBuilder builder)
           
protected  void configurePreProcessors(MessageProcessorChainBuilder builder)
           
protected  MessageProcessor createPipeline()
          Creates a AbstractPipeline.ProcessIfPipelineStartedMessageProcessor that will process messages from the configured MessageSource .
protected  void doDispose()
           
protected  void doInitialise()
           
protected  void doStart()
           
protected  void doStop()
           
 List<MessageProcessor> getMessageProcessors()
           
 MessageSource getMessageSource()
           
 ProcessingStrategy getProcessingStrategy()
           
 String getProcessorPath(MessageProcessor processor)
           
protected  boolean isRedeliveryPolicyConfigured()
           
 boolean isSynchronous()
          Whether the processing represented by this instance is synchronous or not
 void setMessageProcessors(List<MessageProcessor> messageProcessors)
           
 void setMessageSource(MessageSource messageSource)
           
 void setProcessingStrategy(ProcessingStrategy processingStrategy)
           
protected  void validateConstruct()
          Validates configured flow construct
 
Methods inherited from class org.mule.construct.AbstractFlowConstruct
configureStatistics, dispose, disposeIfDisposable, getAnnotation, getAnnotations, getConstructType, getExceptionListener, getInitialState, getLifecycleState, getMessageInfoMapping, getMuleContext, getName, getStatistics, initialise, initialiseIfInitialisable, injectFlowConstructMuleContext, isStarted, isStopped, isStopping, setAnnotations, setExceptionListener, setInitialState, setMessageInfoMapping, start, startIfStartable, stop, stopIfStoppable, 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.construct.FlowConstruct
getExceptionListener, getMessageInfoMapping, getMuleContext, getStatistics
 
Methods inherited from interface org.mule.api.NamedObject
getName
 
Methods inherited from interface org.mule.api.lifecycle.LifecycleStateEnabled
getLifecycleState
 

Field Detail

messageSource

protected MessageSource messageSource

pipeline

protected MessageProcessor pipeline

messageProcessors

protected List<MessageProcessor> messageProcessors

processingStrategy

protected ProcessingStrategy processingStrategy
Constructor Detail

AbstractPipeline

public AbstractPipeline(String name,
                        MuleContext muleContext)
Method Detail

createPipeline

protected MessageProcessor createPipeline()
                                   throws MuleException
Creates a AbstractPipeline.ProcessIfPipelineStartedMessageProcessor that will process messages from the configured MessageSource .

The default implementation of this methods uses a DefaultMessageProcessorChainBuilder and allows a chain of AbstractPipeline.ProcessIfPipelineStartedMessageProcessors to be configured using the configureMessageProcessors(org.mule.api.processor.MessageProcessorChainBuilder) method but if you wish to use another MessageProcessorBuilder or just a single AbstractPipeline.ProcessIfPipelineStartedMessageProcessor then this method can be overridden and return a single AbstractPipeline.ProcessIfPipelineStartedMessageProcessor instead.

Throws:
MuleException

configurePreProcessors

protected void configurePreProcessors(MessageProcessorChainBuilder builder)
                               throws MuleException
Throws:
MuleException

configurePostProcessors

protected void configurePostProcessors(MessageProcessorChainBuilder builder)
                                throws MuleException
Throws:
MuleException

setMessageProcessors

public void setMessageProcessors(List<MessageProcessor> messageProcessors)
Specified by:
setMessageProcessors in interface Pipeline

getMessageProcessors

public List<MessageProcessor> getMessageProcessors()
Specified by:
getMessageProcessors in interface Pipeline

getMessageSource

public MessageSource getMessageSource()
Specified by:
getMessageSource in interface Pipeline

setMessageSource

public void setMessageSource(MessageSource messageSource)
Specified by:
setMessageSource in interface Pipeline

isSynchronous

public boolean isSynchronous()
Description copied from interface: ProcessingDescriptor
Whether the processing represented by this instance is synchronous or not

Specified by:
isSynchronous in interface ProcessingDescriptor

getProcessingStrategy

public ProcessingStrategy getProcessingStrategy()
Specified by:
getProcessingStrategy in interface Pipeline

setProcessingStrategy

public void setProcessingStrategy(ProcessingStrategy processingStrategy)
Specified by:
setProcessingStrategy in interface Pipeline

doInitialise

protected void doInitialise()
                     throws MuleException
Overrides:
doInitialise in class AbstractFlowConstruct
Throws:
MuleException

configureMessageProcessors

protected void configureMessageProcessors(MessageProcessorChainBuilder builder)
                                   throws MuleException
Throws:
MuleException

validateConstruct

protected void validateConstruct()
                          throws FlowConstructInvalidException
Description copied from class: AbstractFlowConstruct
Validates configured flow construct

Overrides:
validateConstruct in class AbstractFlowConstruct
Throws:
FlowConstructInvalidException - if the flow construct does not pass validation

isRedeliveryPolicyConfigured

protected boolean isRedeliveryPolicyConfigured()

doStart

protected void doStart()
                throws MuleException
Overrides:
doStart in class AbstractFlowConstruct
Throws:
MuleException

addMessageProcessorPathElements

public void addMessageProcessorPathElements(MessageProcessorPathElement pathElement)
Description copied from interface: MessageProcessorContainer
Add the child nodes to the path element tree.

Specified by:
addMessageProcessorPathElements in interface MessageProcessorContainer

getProcessorPath

public String getProcessorPath(MessageProcessor processor)
Specified by:
getProcessorPath in interface MessageProcessorPathResolver

doStop

protected void doStop()
               throws MuleException
Overrides:
doStop in class AbstractFlowConstruct
Throws:
MuleException

doDispose

protected void doDispose()
Overrides:
doDispose in class AbstractFlowConstruct


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