org.apache.synapse
Class FaultHandler

java.lang.Object
  extended by org.apache.synapse.FaultHandler
Direct Known Subclasses:
AbstractEndpoint, DynamicLoadbalanceFaultHandler, MediatorFaultHandler

public abstract class FaultHandler
extends Object

This is an abstract class that handles an unexpected error during Synapse mediation, but looking at the stack of registered FaultHanders and invoking on them as appropriate. Sequences and Endpoints would be Synapse entities that handles faults. If such an entity is unable to handle an error condition, then a SynapseException should be thrown, which triggers this fault handling logic.


Constructor Summary
FaultHandler()
           
 
Method Summary
static String getStackTrace(Throwable aThrowable)
          Get the stack trace into a String
 void handleFault(MessageContext synCtx)
           
 void handleFault(MessageContext synCtx, Exception e)
          Extract and set ERROR_MESSAGE and ERROR_DETAIL to the message context from the Exception
abstract  void onFault(MessageContext synCtx)
          This will be executed to handle any Exceptions occurred within the Synapse environment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FaultHandler

public FaultHandler()
Method Detail

handleFault

public void handleFault(MessageContext synCtx)

handleFault

public void handleFault(MessageContext synCtx,
                        Exception e)
Extract and set ERROR_MESSAGE and ERROR_DETAIL to the message context from the Exception

Parameters:
synCtx - the message context
e - the exception encountered

onFault

public abstract void onFault(MessageContext synCtx)
This will be executed to handle any Exceptions occurred within the Synapse environment.

Parameters:
synCtx - SynapseMessageContext of which the fault occured message comprises
Throws:
SynapseException - in case there is a failure in the fault execution

getStackTrace

public static String getStackTrace(Throwable aThrowable)
Get the stack trace into a String

Parameters:
aThrowable -
Returns:
the stack trace as a string


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.