|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.impl.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 multimple endpoints to be associated with
this exception listener and provides an implementaiton for dispatching exception
events from this Listener.
Field Summary | |
protected java.util.List |
endpoints
|
protected Log |
logger
logger used by this class |
Constructor Summary | |
AbstractExceptionListener()
|
Method Summary | |
void |
addEndpoint(UMOEndpoint endpoint)
|
void |
exceptionThrown(java.lang.Exception e)
|
protected UMOEndpoint |
getEndpoint(java.lang.Throwable t)
Returns an endpoint for the given exception. |
java.util.List |
getEndpoints()
|
protected java.lang.Object |
getErrorMessagePayload(UMOMessage message)
|
protected java.lang.Throwable |
getExceptionType(java.lang.Exception e,
java.lang.Class exceptionType)
|
abstract void |
handleLifecycleException(java.lang.Object component,
java.lang.Throwable e)
Lifecycle exceptions are thrown when an error occurs during an object's lifecycle call such as start, stop or initialise. |
abstract void |
handleMessagingException(UMOMessage message,
java.lang.Throwable e)
A messaging exception is thrown when an excpetion occurs during normal message processing A MessagingException holds a reference to the current message that is passed into
this method |
abstract void |
handleRoutingException(UMOMessage message,
UMOEndpoint endpoint,
java.lang.Throwable e)
A routing exception is thrown when an excpetion occurs during normal message processing A RoutingException holds a reference to the current message and te endpoint
being routing to or from when the error occurred. |
abstract void |
handleStandardException(java.lang.Throwable e)
A handler for all other exceptions |
void |
initialise()
Method used to perform any initialisation work. |
protected void |
logException(java.lang.Throwable t)
Used to log the error passed into this Exception Listener |
protected void |
logFatal(UMOMessage message,
java.lang.Throwable t)
Logs a fatal error message to the logging system. |
protected void |
markTransactionForRollback()
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 |
boolean |
removeEndpoint(UMOEndpoint endpoint)
|
protected void |
routeException(UMOMessage message,
UMOEndpoint failedEndpoint,
java.lang.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 UMOMassage available to dispatch. |
void |
setEndpoints(java.util.List endpoints)
|
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 java.util.List endpoints
Constructor Detail |
public AbstractExceptionListener()
Method Detail |
public java.util.List getEndpoints()
public void setEndpoints(java.util.List endpoints)
public void addEndpoint(UMOEndpoint endpoint)
public boolean removeEndpoint(UMOEndpoint endpoint)
public void exceptionThrown(java.lang.Exception e)
exceptionThrown
in interface java.beans.ExceptionListener
protected java.lang.Throwable getExceptionType(java.lang.Exception e, java.lang.Class exceptionType)
public void initialise() throws InitialisationException, RecoverableException
Initialisable
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.
initialise
in interface Initialisable
InitialisationException
- if a fatal error occurs causing the Mule instance to
shutdown
RecoverableException
- if an error occurs that can be recovered fromprotected void markTransactionForRollback()
protected void routeException(UMOMessage message, UMOEndpoint failedEndpoint, java.lang.Throwable t)
ExceptionMessage
which contains the
exception thrown the UMOMessage and any context information.
message
- the UMOMessage being processed when the exception occurredfailedEndpoint
- optional; the endpoint being dispatched or recieved 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 java.lang.Object getErrorMessagePayload(UMOMessage message)
protected UMOEndpoint getEndpoint(java.lang.Throwable t)
t
- the exception thrown
protected void logException(java.lang.Throwable t)
t
- the exception thrownprotected void logFatal(UMOMessage message, java.lang.Throwable t)
message
- The UMOMessage currently being processedt
- the fatal exception to logpublic abstract void handleMessagingException(UMOMessage message, java.lang.Throwable e)
MessagingException
holds a reference to the current message that is passed into
this method
message
- the current message being processede
- the top level exception thrown. This may be a Messaging exception or some
wrapper exceptionMessagingException
public abstract void handleRoutingException(UMOMessage message, UMOEndpoint endpoint, java.lang.Throwable e)
RoutingException
holds a reference to the current message and te endpoint
being routing to or from when the error occurred. Both are passed into this method
message
- the current message being processedendpoint
- the endpoint being dispatched to or received from when the error
occurrede
- the top level exception thrown. This may be a Messaging exception or some
wrapper exceptionRoutingException
public abstract void handleLifecycleException(java.lang.Object component, java.lang.Throwable e)
component
- the object that failed during a lifecycle calle
- the top level exception thrown. This may or may not be the LifecycleException
but a lifecycle exception will be present in the exception stack.LifecycleException
public abstract void handleStandardException(java.lang.Throwable e)
e
- the top level exception thrown
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |