org.mule.exception
Class ChoiceMessagingExceptionStrategy

java.lang.Object
  extended by org.mule.processor.AbstractMuleObjectOwner<MessagingExceptionHandlerAcceptor>
      extended by org.mule.exception.ChoiceMessagingExceptionStrategy
All Implemented Interfaces:
Acceptor, FlowConstructAware, MuleContextAware, ExceptionHandler, MessagingExceptionHandler, MessagingExceptionHandlerAcceptor, GlobalNameableObject, Disposable, Initialisable, Lifecycle, Startable, Stoppable, MessageProcessorContainer

public class ChoiceMessagingExceptionStrategy
extends AbstractMuleObjectOwner<MessagingExceptionHandlerAcceptor>
implements MessagingExceptionHandlerAcceptor, MuleContextAware, Lifecycle, MessageProcessorContainer, GlobalNameableObject

Selects which exception strategy to execute based on filtering.

Exception listeners must implement MessagingExceptionHandlerAcceptor to be part of ChoiceMessagingExceptionStrategy


Field Summary
protected  String globalName
           
 
Fields inherited from class org.mule.processor.AbstractMuleObjectOwner
flowConstruct, muleContext
 
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
ChoiceMessagingExceptionStrategy()
           
 
Method Summary
 boolean accept(MuleEvent event)
           
 boolean acceptsAll()
           
 void addMessageProcessorPathElements(MessageProcessorPathElement pathElement)
          Add the child nodes to the path element tree.
 List<MessagingExceptionHandlerAcceptor> getExceptionListeners()
           
 String getGlobalName()
           
protected  List<MessagingExceptionHandlerAcceptor> getOwnedObjects()
           
 MuleEvent handleException(Exception exception, MuleEvent event)
          Take some action when a messaging exception has occurred (i.e., there was a message in play when the exception occurred).
 void initialise()
          Method used to perform any initialisation work.
 void setExceptionListeners(List<MessagingExceptionHandlerAcceptor> exceptionListeners)
           
 void setGlobalName(String globalName)
           
 
Methods inherited from class org.mule.processor.AbstractMuleObjectOwner
dispose, getFlowConstruct, getMuleContext, setFlowConstruct, setMuleContext, start, 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.context.MuleContextAware
setMuleContext
 
Methods inherited from interface org.mule.api.lifecycle.Startable
start
 
Methods inherited from interface org.mule.api.lifecycle.Stoppable
stop
 
Methods inherited from interface org.mule.api.lifecycle.Disposable
dispose
 

Field Detail

globalName

protected String globalName
Constructor Detail

ChoiceMessagingExceptionStrategy

public ChoiceMessagingExceptionStrategy()
Method Detail

getGlobalName

public String getGlobalName()
Specified by:
getGlobalName in interface GlobalNameableObject

setGlobalName

public void setGlobalName(String globalName)
Specified by:
setGlobalName in interface GlobalNameableObject

handleException

public MuleEvent handleException(Exception exception,
                                 MuleEvent event)
Description copied from interface: MessagingExceptionHandler
Take some action when a messaging exception has occurred (i.e., there was a message in play when the exception occurred).

Specified by:
handleException in interface MessagingExceptionHandler
Parameters:
exception - which occurred
event - which was being processed when the exception occurred
Returns:
new event to route on to the rest of the flow, generally with ExceptionPayload set on the message

setExceptionListeners

public void setExceptionListeners(List<MessagingExceptionHandlerAcceptor> exceptionListeners)

getExceptionListeners

public List<MessagingExceptionHandlerAcceptor> getExceptionListeners()

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

getOwnedObjects

protected List<MessagingExceptionHandlerAcceptor> getOwnedObjects()
Specified by:
getOwnedObjects in class AbstractMuleObjectOwner<MessagingExceptionHandlerAcceptor>

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

accept

public boolean accept(MuleEvent event)
Specified by:
accept in interface Acceptor
Parameters:
event - MuleEvent to route through exception handler
Returns:
true if this MessagingExceptionHandler should handler exception false otherwise

acceptsAll

public boolean acceptsAll()
Specified by:
acceptsAll in interface Acceptor
Returns:
true if accepts any message, false otherwise.


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