public abstract class AbstractExceptionListener extends AbstractMessageProcessorOwner implements GlobalNameableObject
AbstractMessagingExceptionStrategy
(if you are creating a Messaging Exception Strategy)
or AbstractSystemExceptionStrategy
(if you are creating a System Exception Strategy) rather than directly from this class.Modifier and Type | Field and Description |
---|---|
protected WildcardFilter |
commitTxFilter |
protected boolean |
enableNotifications |
protected String |
globalName |
protected AtomicBoolean |
initialised |
protected String |
logException |
protected Log |
logger |
protected List<MessageProcessor> |
messageProcessors |
protected static String |
NOT_SET |
protected WildcardFilter |
rollbackTxFilter |
flowConstruct, messagingExceptionHandler, muleContext
PHASE_NAME
PHASE_NAME
PHASE_NAME
PHASE_NAME
PROPERTY_NAME
Constructor and Description |
---|
AbstractExceptionListener() |
Modifier and Type | Method and Description |
---|---|
void |
addEndpoint(MessageProcessor processor) |
protected void |
closeStream(MuleMessage message) |
protected void |
commit() |
protected void |
doInitialise(MuleContext context) |
protected void |
doLogException(Throwable t) |
protected void |
fireNotification(Exception ex) |
protected void |
fireNotification(ServerNotification notification)
Fires a server notification to all registered
ExceptionNotificationListener
eventManager. |
WildcardFilter |
getCommitTxFilter() |
protected Throwable |
getExceptionType(Throwable t,
Class<? extends Throwable> exceptionType) |
String |
getGlobalName() |
List<MessageProcessor> |
getMessageProcessors() |
protected List<MessageProcessor> |
getOwnedMessageProcessors() |
WildcardFilter |
getRollbackTxFilter() |
protected void |
handleTransaction(Throwable t)
Deprecated.
this method should not be used anymore. Transactions must be handled by provided ExceptionStrategy
|
void |
initialise()
The initialise method is call every time the Exception stategy is assigned to
a service or connector.
|
boolean |
isEnableNotifications() |
boolean |
isInitialised() |
String |
isLogException()
Determines whether the handled exception will be logged to its standard logger in the ERROR level before being handled.
|
protected boolean |
isRollback(Throwable t) |
protected void |
logException(Throwable t,
MuleEvent event)
Used to log the error passed into this Exception Listener
|
protected void |
logFatal(MuleEvent event,
Throwable t)
Logs a fatal error message to the logging system.
|
boolean |
removeMessageProcessor(MessageProcessor processor) |
protected void |
rollback(Exception ex) |
protected void |
rollback(RollbackSourceCallback rollbackMethod)
Deprecated.
use
rollback(Exception) instead |
protected void |
rollbackTransaction()
Deprecated.
use
rollback(Exception) instead.
parameter should be null |
protected void |
routeException(MuleEvent event,
MessageProcessor target,
Throwable t)
Deprecated.
|
protected void |
routeException(MuleEvent event,
Throwable t)
Routes the current exception to an error endpoint such as a Dead Letter Queue
(jms) This method is only invoked if there is a MuleMessage available to
dispatch.
|
void |
setCommitTxFilter(WildcardFilter commitTxFilter) |
void |
setEnableNotifications(boolean enableNotifications) |
void |
setGlobalName(String globalName) |
void |
setLogException(String logException) |
void |
setMessageProcessors(List<MessageProcessor> processors) |
void |
setMessagingExceptionHandler(MessagingExceptionHandler messagingExceptionHandler) |
void |
setRollbackTxFilter(WildcardFilter rollbackTxFilter) |
addMessageProcessorPathElements, getAnnotation, getAnnotations, getOwnedObjects, setAnnotations
dispose, getFlowConstruct, getMessagingExceptionHandler, getMuleContext, setFlowConstruct, setMuleContext, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dispose
setMuleContext
setFlowConstruct
protected static final String NOT_SET
protected transient Log logger
protected List<MessageProcessor> messageProcessors
protected AtomicBoolean initialised
protected WildcardFilter rollbackTxFilter
protected WildcardFilter commitTxFilter
protected boolean enableNotifications
protected String logException
protected String globalName
public String getGlobalName()
getGlobalName
in interface GlobalNameableObject
public void setGlobalName(String globalName)
setGlobalName
in interface GlobalNameableObject
protected boolean isRollback(Throwable t)
public List<MessageProcessor> getMessageProcessors()
public void setMessageProcessors(List<MessageProcessor> processors)
public void addEndpoint(MessageProcessor processor)
public boolean removeMessageProcessor(MessageProcessor processor)
protected Throwable getExceptionType(Throwable t, Class<? extends Throwable> exceptionType)
public final void initialise() throws InitialisationException
doInitialise()
method.initialise
in interface Initialisable
initialise
in class AbstractMuleObjectOwner<MessageProcessor>
InitialisationException
RecoverableException
- if an error occurs that can be recovered fromprotected void doInitialise(MuleContext context) throws InitialisationException
InitialisationException
protected void fireNotification(Exception ex)
protected void routeException(MuleEvent event, Throwable t)
ExceptionMessage
which contains the exception thrown the
MuleMessage and any context information.event
- the MuleEvent being processed when the exception occurredt
- the exception thrown. This will be sent with the ExceptionMessageExceptionMessage
@Deprecated protected void routeException(MuleEvent event, MessageProcessor target, Throwable t)
routeException(org.mule.api.MuleEvent, Throwable)
instead@Deprecated protected void rollback(RollbackSourceCallback rollbackMethod)
rollback(Exception)
insteadprotected void closeStream(MuleMessage message)
protected void logException(Throwable t, MuleEvent event)
t
- the exception thrownprotected void doLogException(Throwable t)
protected void logFatal(MuleEvent event, Throwable t)
event
- The MuleEvent currently being processedt
- the fatal exception to logpublic boolean isInitialised()
protected void fireNotification(ServerNotification notification)
ExceptionNotificationListener
eventManager.notification
- the notification to fire.public WildcardFilter getCommitTxFilter()
public void setCommitTxFilter(WildcardFilter commitTxFilter)
public boolean isEnableNotifications()
public void setEnableNotifications(boolean enableNotifications)
public String isLogException()
public void setLogException(String logException)
public WildcardFilter getRollbackTxFilter()
public void setRollbackTxFilter(WildcardFilter rollbackTxFilter)
protected List<MessageProcessor> getOwnedMessageProcessors()
getOwnedMessageProcessors
in class AbstractMessageProcessorOwner
public void setMessagingExceptionHandler(MessagingExceptionHandler messagingExceptionHandler)
setMessagingExceptionHandler
in interface MessagingExceptionHandlerAware
setMessagingExceptionHandler
in class AbstractMuleObjectOwner<MessageProcessor>
@Deprecated protected void rollbackTransaction()
rollback(Exception)
instead.
parameter should be null@Deprecated protected void handleTransaction(Throwable t)
protected void commit()
protected void rollback(Exception ex)
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.