|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.processor.AbstractMessageProcessorOwner
org.mule.exception.AbstractExceptionListener
public abstract class AbstractExceptionListener
AbstractExceptionListener
is a base implementation that custom
Exception Listeners can override. It provides template methods for handling the
for base types of exceptions plus allows multiple targets to be associated with
this exception listener and provides an implementation for dispatching exception
events from this Listener.
Field Summary | |
---|---|
protected WildcardFilter |
commitTxFilter
|
protected boolean |
enableNotifications
|
protected AtomicBoolean |
initialised
|
protected Log |
logger
logger used by this class |
protected List<MessageProcessor> |
messageProcessors
|
protected WildcardFilter |
rollbackTxFilter
|
Fields inherited from class org.mule.processor.AbstractMessageProcessorOwner |
---|
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 | |
---|---|
AbstractExceptionListener()
|
Method Summary | |
---|---|
void |
addEndpoint(MessageProcessor processor)
|
protected void |
closeStream(MuleMessage message)
|
protected void |
doInitialise(MuleContext muleContext)
|
protected void |
fireNotification(ExceptionNotification notification)
Fires a server notification to all registered ExceptionNotificationListener
eventManager. |
WildcardFilter |
getCommitTxFilter()
|
protected Throwable |
getExceptionType(Throwable t,
Class exceptionType)
|
List<MessageProcessor> |
getMessageProcessors()
|
protected List<MessageProcessor> |
getOwnedMessageProcessors()
|
WildcardFilter |
getRollbackTxFilter()
|
protected void |
handleTransaction(Throwable t)
If there is a current transaction this method will mark it for rollback This method should not be called if an event is routed from this exception handler to an endpoint that should take part in the current transaction |
void |
initialise()
The initialise method is call every time the Exception stategy is assigned to a service or connector. |
boolean |
isEnableNotifications()
|
boolean |
isInitialised()
|
protected boolean |
isRollback(Throwable t)
|
protected void |
logException(Throwable t)
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 |
rollbackTransaction()
|
protected void |
routeException(MuleEvent event,
MessageProcessor target,
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 |
setMessageProcessors(List<MessageProcessor> processors)
|
void |
setRollbackTxFilter(WildcardFilter rollbackTxFilter)
|
Methods inherited from class org.mule.processor.AbstractMessageProcessorOwner |
---|
dispose, setFlowConstruct, setMuleContext, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient Log logger
protected List<MessageProcessor> messageProcessors
protected AtomicBoolean initialised
protected WildcardFilter rollbackTxFilter
protected WildcardFilter commitTxFilter
protected boolean enableNotifications
Constructor Detail |
---|
public AbstractExceptionListener()
Method Detail |
---|
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 exceptionType)
public final void initialise() throws InitialisationException
doInitialise()
method.
initialise
in interface Initialisable
initialise
in class AbstractMessageProcessorOwner
InitialisationException
RecoverableException
- if an error occurs that can be recovered fromprotected void doInitialise(MuleContext muleContext) throws InitialisationException
InitialisationException
protected void handleTransaction(Throwable t)
protected boolean isRollback(Throwable t)
protected void rollbackTransaction()
protected void routeException(MuleEvent event, MessageProcessor target, Throwable t)
ExceptionMessage
which contains the exception thrown the
MuleMessage and any context information.
message
- the MuleMessage being processed when the exception occurredtarget
- optional; the endpoint being dispatched or received on
when the error occurred. This is NOT the endpoint that the message
will be disptched on and is only supplied to this method for
logging purposest
- the exception thrown. This will be sent with the ExceptionMessageExceptionMessage
protected void closeStream(MuleMessage message)
protected void logException(Throwable t)
t
- the exception thrownprotected void logFatal(MuleEvent event, Throwable t)
message
- The MuleMessage currently being processedt
- the fatal exception to logpublic boolean isInitialised()
protected void fireNotification(ExceptionNotification 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 WildcardFilter getRollbackTxFilter()
public void setRollbackTxFilter(WildcardFilter rollbackTxFilter)
protected List<MessageProcessor> getOwnedMessageProcessors()
getOwnedMessageProcessors
in class AbstractMessageProcessorOwner
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |