Package org.apache.synapse
Class FaultHandler
- java.lang.Object
-
- 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
Constructors Constructor Description FaultHandler()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
executeExtendedSynapseHandlerOnFault(MessageContext synCtx)
Execute the ExtendedSynapseHandler in the error flow.static String
getStackTrace(Throwable aThrowable)
Get the stack trace into a Stringvoid
handleFault(MessageContext synCtx)
void
handleFault(MessageContext synCtx, Exception e)
Extract and set ERROR_MESSAGE and ERROR_DETAIL to the message context from the Exceptionabstract void
onFault(MessageContext synCtx)
This will be executed to handle any Exceptions occurred within the Synapse environment.
-
-
-
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 contexte
- 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
-
executeExtendedSynapseHandlerOnFault
protected void executeExtendedSynapseHandlerOnFault(MessageContext synCtx)
Execute the ExtendedSynapseHandler in the error flow.- Parameters:
synCtx
- Synapse Message Context
-
-