org.mule.processor.chain
Class AbstractMessageProcessorChain

java.lang.Object
  extended by org.mule.processor.AbstractInterceptingMessageProcessorBase
      extended by org.mule.processor.AbstractInterceptingMessageProcessor
          extended by org.mule.processor.chain.AbstractMessageProcessorChain
All Implemented Interfaces:
AnnotatedObject, FlowConstructAware, MuleContextAware, Disposable, Initialisable, Lifecycle, Startable, Stoppable, NamedObject, InterceptingMessageProcessor, MessageProcessor, MessageProcessorChain, MessageSource, EndpointAware
Direct Known Subclasses:
DefaultMessageProcessorChain, InterceptingChainLifecycleWrapper

public abstract class AbstractMessageProcessorChain
extends AbstractInterceptingMessageProcessor
implements MessageProcessorChain, Lifecycle, FlowConstructAware, MuleContextAware, EndpointAware

Builder needs to return a composite rather than the first MessageProcessor in the chain. This is so that if this chain is nested in another chain the next MessageProcessor in the parent chain is not injected into the first in the nested chain.


Field Summary
protected  Log log
           
protected  String name
           
protected  List<MessageProcessor> processors
           
 
Fields inherited from class org.mule.processor.AbstractInterceptingMessageProcessorBase
logger, muleContext, next, notificationHandler
 
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
AbstractMessageProcessorChain(String name, List<MessageProcessor> processors)
           
 
Method Summary
 void dispose()
          A lifecycle method where implementor should free up any resources.
protected abstract  MuleEvent doProcess(MuleEvent event)
           
 List<MessageProcessor> getMessageProcessors()
           
 String getName()
          Gets the name of the object
 void initialise()
          Method used to perform any initialisation work.
 MuleEvent process(MuleEvent event)
          Invokes the MessageProcessor.
 void setEndpoint(ImmutableEndpoint endpoint)
           
 void setFlowConstruct(FlowConstruct flowConstruct)
           
 void start()
           
 void stop()
           
 String toString()
           
 
Methods inherited from class org.mule.processor.AbstractInterceptingMessageProcessorBase
getAnnotation, getAnnotations, getListener, getMuleContext, isEventValid, processNext, setAnnotations, setListener, setMuleContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.api.context.MuleContextAware
setMuleContext
 
Methods inherited from interface org.mule.api.source.MessageSource
setListener
 

Field Detail

log

protected final transient Log log

name

protected String name

processors

protected List<MessageProcessor> processors
Constructor Detail

AbstractMessageProcessorChain

public AbstractMessageProcessorChain(String name,
                                     List<MessageProcessor> processors)
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

doProcess

protected abstract MuleEvent doProcess(MuleEvent event)
                                throws MuleException
Throws:
MuleException

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

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

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

setFlowConstruct

public void setFlowConstruct(FlowConstruct flowConstruct)
Specified by:
setFlowConstruct in interface FlowConstructAware

getName

public String getName()
Description copied from interface: NamedObject
Gets the name of the object

Specified by:
getName in interface NamedObject
Returns:
the name of the object

toString

public String toString()
Overrides:
toString in class AbstractInterceptingMessageProcessorBase

setEndpoint

public void setEndpoint(ImmutableEndpoint endpoint)
Specified by:
setEndpoint in interface EndpointAware

getMessageProcessors

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


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