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 org.slf4j.Logger |
logger |
protected List<Processor> |
messageProcessors |
protected static String |
NOT_SET |
protected WildcardFilter |
rollbackTxFilter |
flowConstruct, messagingExceptionHandler, muleContext| Constructor and Description |
|---|
AbstractExceptionListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
addEndpoint(Processor processor) |
protected MulticastingRouter |
buildRouter() |
protected void |
closeStream(org.mule.runtime.api.message.Message message) |
protected void |
commit() |
protected void |
doInitialise(MuleContext context) |
protected void |
doLogException(Throwable t) |
protected void |
fireNotification(Exception ex,
Event event) |
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<Processor> |
getMessageProcessors() |
protected List<Processor> |
getOwnedMessageProcessors() |
WildcardFilter |
getRollbackTxFilter() |
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,
Event event)
Used to log the error passed into this Exception Listener
|
protected void |
logFatal(Event event,
Throwable t)
Logs a fatal error message to the logging system.
|
boolean |
removeMessageProcessor(Processor processor) |
protected void |
rollback(Exception ex) |
protected Event |
routeException(Event event,
FlowConstruct flowConstruct,
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
Message available to dispatch.
|
void |
setCommitTxFilter(WildcardFilter commitTxFilter) |
void |
setEnableNotifications(boolean enableNotifications) |
void |
setGlobalName(String globalName) |
void |
setLogException(String logException) |
void |
setMessageProcessors(List<Processor> processors) |
void |
setMessagingExceptionHandler(MessagingExceptionHandler messagingExceptionHandler) |
void |
setRollbackTxFilter(WildcardFilter rollbackTxFilter) |
getOwnedObjectsdispose, getFlowConstruct, getMuleContext, setFlowConstruct, setMuleContext, start, stopgetAnnotation, getAnnotations, getLocation, setAnnotationsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetMuleContextsetFlowConstructprotected static final String NOT_SET
protected transient org.slf4j.Logger logger
protected AtomicBoolean initialised
protected WildcardFilter rollbackTxFilter
protected WildcardFilter commitTxFilter
protected boolean enableNotifications
protected String logException
protected String globalName
public String getGlobalName()
getGlobalName in interface GlobalNameableObjectpublic void setGlobalName(String globalName)
setGlobalName in interface GlobalNameableObjectprotected boolean isRollback(Throwable t)
public void addEndpoint(Processor processor)
public boolean removeMessageProcessor(Processor processor)
protected Throwable getExceptionType(Throwable t, Class<? extends Throwable> exceptionType)
public final void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
doInitialise()
method.initialise in interface org.mule.runtime.api.lifecycle.Initialisableinitialise in class AbstractMuleObjectOwner<Processor>org.mule.runtime.api.lifecycle.InitialisationExceptionprotected void doInitialise(MuleContext context) throws org.mule.runtime.api.lifecycle.InitialisationException
org.mule.runtime.api.lifecycle.InitialisationExceptionprotected Event routeException(Event event, FlowConstruct flowConstruct, Throwable t)
ExceptionMessage which
contains the exception thrown the Message and any context information.event - the MuleEvent being processed when the exception occurredflowConstruct - the flow that was processing the event when the exception occurred.t - the exception thrown. This will be sent with the ExceptionMessageExceptionMessageprotected MulticastingRouter buildRouter()
protected void closeStream(org.mule.runtime.api.message.Message message)
protected void logException(Throwable t, Event event)
t - the exception thrownprotected void doLogException(Throwable t)
protected void logFatal(Event 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<Processor> getOwnedMessageProcessors()
getOwnedMessageProcessors in class AbstractMessageProcessorOwnerpublic void setMessagingExceptionHandler(MessagingExceptionHandler messagingExceptionHandler)
setMessagingExceptionHandler in interface MessagingExceptionHandlerAwaresetMessagingExceptionHandler in class AbstractMuleObjectOwner<Processor>protected void commit()
protected void rollback(Exception ex)
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.