org.mule.api
Class MessagingException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.mule.api.MuleException
              extended by org.mule.api.MessagingException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ComponentException, CompositeRoutingException, CorrelationTimeoutException, FailedToQueueEventException, FilterUnacceptedException, MessageRedeliveredException, ResourceNotFoundException, ResponseDispatchException, RestServiceException, RoutingException, RoutingFailedMessagingException, SecurityException, SoapFaultException, TransformerMessagingException

public class MessagingException
extends MuleException

MessagingException is a general message exception thrown when errors specific to Message processing occur..

See Also:
Serialized Form

Field Summary
protected  MuleEvent event
          The MuleEvent being processed when the error occurred
protected  MuleMessage muleMessage
          The MuleMessage being processed when the error occurred
protected  MuleEvent processedEvent
           
 
Constructor Summary
MessagingException(Message message, MuleEvent event)
           
MessagingException(Message message, MuleEvent event, MessageProcessor failingMessageProcessor)
           
MessagingException(Message message, MuleEvent event, Throwable cause)
           
MessagingException(Message message, MuleEvent event, Throwable cause, MessageProcessor failingMessageProcessor)
           
MessagingException(Message message, MuleMessage muleMessage)
          Deprecated. use MessagingException(Message, MuleEvent)
MessagingException(Message message, MuleMessage muleMessage, Throwable cause)
          Deprecated. use MessagingException(Message, MuleEvent, Throwable)
MessagingException(MuleEvent event, Throwable cause)
           
MessagingException(MuleEvent event, Throwable cause, MessageProcessor failingMessageProcessor)
           
 
Method Summary
 boolean causedBy(Class e)
          Evaluates if the exception was caused (instance of) by the provided exception type
 boolean causedExactlyBy(Class e)
          Evaluates if the exception was caused by the type and only the type provided exception type i,e: if cause exception is NullPointerException will only return true if provided exception type is NullPointerException
 boolean causedRollback()
          Signals if the exception cause rollback of any current transaction if any or if the message source should rollback incoming message
 boolean causeMatches(String regex)
          Checks the cause exception type name matches the provided regex.
protected  void extractMuleMessage(MuleEvent event)
           
 Exception getCauseException()
           
 MuleEvent getEvent()
           
 MessageProcessor getFailingMessageProcessor()
           
 MuleMessage getMuleMessage()
          Deprecated. use #getEvent().getMessage() instead
 boolean handled()
          Signals if exception has been handled or not
 void setCauseRollback(boolean causeRollback)
          Marks exception as rollback cause.
 void setHandled(boolean handled)
          Marks an exception as handled so it won't be re-throwed
 void setProcessedEvent(MuleEvent processedEvent)
          Sets the event that should be processed once this exception is caught
 
Methods inherited from class org.mule.api.MuleException
addInfo, appendMessage, equals, getDetailedMessage, getExceptionCode, getI18nMessage, getInfo, getMessage, getMessageCode, getSummaryMessage, getVerboseMessage, hashCode, initialise, prependMessage, setExceptionCode, setMessage, setMessage
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

muleMessage

protected transient MuleMessage muleMessage
The MuleMessage being processed when the error occurred


event

protected final transient MuleEvent event
The MuleEvent being processed when the error occurred


processedEvent

protected transient MuleEvent processedEvent
Constructor Detail

MessagingException

@Deprecated
public MessagingException(Message message,
                                     MuleMessage muleMessage)
Deprecated. use MessagingException(Message, MuleEvent)


MessagingException

public MessagingException(Message message,
                          MuleEvent event)

MessagingException

public MessagingException(Message message,
                          MuleEvent event,
                          MessageProcessor failingMessageProcessor)

MessagingException

@Deprecated
public MessagingException(Message message,
                                     MuleMessage muleMessage,
                                     Throwable cause)
Deprecated. use MessagingException(Message, MuleEvent, Throwable)


MessagingException

public MessagingException(Message message,
                          MuleEvent event,
                          Throwable cause)

MessagingException

public MessagingException(Message message,
                          MuleEvent event,
                          Throwable cause,
                          MessageProcessor failingMessageProcessor)

MessagingException

public MessagingException(MuleEvent event,
                          Throwable cause)

MessagingException

public MessagingException(MuleEvent event,
                          Throwable cause,
                          MessageProcessor failingMessageProcessor)
Method Detail

getMuleMessage

@Deprecated
public MuleMessage getMuleMessage()
Deprecated. use #getEvent().getMessage() instead


getEvent

public MuleEvent getEvent()
Returns:
event associated with the exception

setProcessedEvent

public void setProcessedEvent(MuleEvent processedEvent)
Sets the event that should be processed once this exception is caught

Parameters:
processedEvent - event bounded to the exception

causedBy

public boolean causedBy(Class e)
Evaluates if the exception was caused (instance of) by the provided exception type

Parameters:
e - exception type to check against
Returns:
true if the cause exception is an instance of the provided exception type

causedExactlyBy

public boolean causedExactlyBy(Class e)
Evaluates if the exception was caused by the type and only the type provided exception type i,e: if cause exception is NullPointerException will only return true if provided exception type is NullPointerException

Parameters:
e - exception type to check against
Returns:
true if the cause exception is exaclty the provided exception type

getCauseException

public Exception getCauseException()
Returns:
the exception thrown by the failing message processor

causeMatches

public boolean causeMatches(String regex)
Checks the cause exception type name matches the provided regex. Supports any java regex plus *, * prefix, * sufix

Parameters:
regex - regular expression to match against the exception type name
Returns:
true if the exception matches the regex, false otherwise

causedRollback

public boolean causedRollback()
Signals if the exception cause rollback of any current transaction if any or if the message source should rollback incoming message

Returns:
true if exception cause rollback, false otherwise

setCauseRollback

public void setCauseRollback(boolean causeRollback)
Marks exception as rollback cause. Useful for message sources that can provide some rollback mechanism.

Parameters:
causeRollback -

setHandled

public void setHandled(boolean handled)
Marks an exception as handled so it won't be re-throwed

Parameters:
handled - true if the exception must be mark as handled, false otherwise

handled

public boolean handled()
Signals if exception has been handled or not

Returns:
true if exception has been handled, false otherwise

getFailingMessageProcessor

public MessageProcessor getFailingMessageProcessor()
Returns:
MessageProcessor that causes the failure

extractMuleMessage

protected void extractMuleMessage(MuleEvent event)


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