Class 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 Detail

      • FaultHandler

        public FaultHandler()
    • Method Detail

      • 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
      • executeExtendedSynapseHandlerOnFault

        protected void executeExtendedSynapseHandlerOnFault​(MessageContext synCtx)
        Execute the ExtendedSynapseHandler in the error flow.
        Parameters:
        synCtx - Synapse Message Context