Package org.mule.exception

Examples of org.mule.exception.RollbackMessagingExceptionStrategy


    {
        /*TODO Next commit will fix this horrible thing:
         inbound endpoint should only be aware of a redelivery policy configured on it
         flowConstruct should be responsible of redelivery policy use */
        AbstractRedeliveryPolicy redeliveryPolicy = super.getRedeliveryPolicy();
        RollbackMessagingExceptionStrategy rollbackMessagingExceptionStrategy = null;
        if (flowConstruct != null && flowConstruct.getExceptionListener() != null)
        {
            MessagingExceptionHandler exceptionListener = flowConstruct.getExceptionListener();
            if (exceptionListener instanceof RollbackMessagingExceptionStrategy)
            {
                rollbackMessagingExceptionStrategy = (RollbackMessagingExceptionStrategy) exceptionListener;
            }
            else if (exceptionListener instanceof ChoiceMessagingExceptionStrategy)
            {
                ChoiceMessagingExceptionStrategy choiceMessagingExceptionStrategy = (ChoiceMessagingExceptionStrategy) exceptionListener;
                for (MessagingExceptionHandlerAcceptor messagingExceptionHandlerAcceptor : choiceMessagingExceptionStrategy.getExceptionListeners())
                {
                    if (messagingExceptionHandlerAcceptor instanceof RollbackMessagingExceptionStrategy && ((RollbackMessagingExceptionStrategy) messagingExceptionHandlerAcceptor).hasMaxRedeliveryAttempts())
                    {
                        rollbackMessagingExceptionStrategy = (RollbackMessagingExceptionStrategy) messagingExceptionHandlerAcceptor;
                        break;
                    }
                }
            }
        }
        if (rollbackMessagingExceptionStrategy != null && rollbackMessagingExceptionStrategy.hasMaxRedeliveryAttempts())
        {
            if (redeliveryPolicy == null)
            {
                redeliveryPolicy = createDefaultRedeliveryPolicy(rollbackMessagingExceptionStrategy.getMaxRedeliveryAttempts());
            }
            else
            {
                redeliveryPolicy.setMaxRedeliveryCount(rollbackMessagingExceptionStrategy.getMaxRedeliveryAttempts());
            }
        }
        return redeliveryPolicy;
    }
View Full Code Here

TOP

Related Classes of org.mule.exception.RollbackMessagingExceptionStrategy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.