|
|||||||||||
| 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 List |
endpoints
|
protected AtomicBoolean |
initialised
|
protected Log |
logger
logger used by this class |
| Constructor Summary | |
AbstractExceptionListener()
|
|
| Method Summary | |
void |
addEndpoint(UMOEndpoint endpoint)
|
protected void |
doInitialise()
|
void |
exceptionThrown(Exception e)
|
protected UMOEndpoint |
getEndpoint(Throwable t)
Returns an endpoint for the given exception. |
List |
getEndpoints()
|
protected Object |
getErrorMessagePayload(UMOMessage message)
|
protected Throwable |
getExceptionType(Exception e,
Class exceptionType)
|
abstract void |
handleLifecycleException(Object component,
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,
Throwable e)
A messaging exception is thrown when an excpetion occurs during normal message processing. |
abstract void |
handleRoutingException(UMOMessage message,
UMOImmutableEndpoint endpoint,
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(Throwable e)
A handler for all other exceptions |
void |
initialise()
The initialise method is call every time the Exception stategy is assigned to a component or connector. |
boolean |
isInitialised()
|
protected void |
logException(Throwable t)
Used to log the error passed into this Exception Listener |
protected void |
logFatal(UMOMessage message,
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,
UMOImmutableEndpoint failedEndpoint,
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 UMOMessage available to dispatch. |
void |
setEndpoints(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 List endpoints
protected AtomicBoolean initialised
| Constructor Detail |
public AbstractExceptionListener()
| Method Detail |
public List getEndpoints()
public void setEndpoints(List endpoints)
public void addEndpoint(UMOEndpoint endpoint)
public boolean removeEndpoint(UMOEndpoint endpoint)
public void exceptionThrown(Exception e)
exceptionThrown in interface ExceptionListener
protected Throwable getExceptionType(Exception e,
Class exceptionType)
public final void initialise()
throws InitialisationException
doInitialise() method.
initialise in interface InitialisableInitialisationException
protected void doInitialise()
throws InitialisationException
InitialisationExceptionprotected void markTransactionForRollback()
protected void routeException(UMOMessage message,
UMOImmutableEndpoint failedEndpoint,
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 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 ExceptionMessageExceptionMessageprotected Object getErrorMessagePayload(UMOMessage message)
protected UMOEndpoint getEndpoint(Throwable t)
t - the exception thrown
protected void logException(Throwable t)
t - the exception thrown
protected void logFatal(UMOMessage message,
Throwable t)
message - The UMOMessage currently being processedt - the fatal exception to logpublic boolean isInitialised()
public abstract void handleMessagingException(UMOMessage message,
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,
UMOImmutableEndpoint endpoint,
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(Object component,
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.LifecycleExceptionpublic abstract void handleStandardException(Throwable e)
e - the top level exception thrown
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||