Package org.mule.api

Examples of org.mule.api.MuleException


     *
     * @param t the exception thrown
     */
    protected void logException(Throwable t)
    {
        MuleException muleException = ExceptionHelper.getRootMuleException(t);
        if (muleException != null)
        {
            logger.error(muleException.getDetailedMessage());
        }
        else
        {
            logger.error("Caught exception in Exception Strategy: " + t.getMessage(), t);
        }
View Full Code Here


    }

    public static MuleException getRootMuleException(Throwable t)
    {
        Throwable cause = t;
        MuleException exception = null;
        while (cause != null)
        {
            if (cause instanceof MuleException)
            {
                exception = (MuleException) cause;
View Full Code Here

            {
                ExceptionPayload wsException = message.getExceptionPayload();

                if (wsException != null)
                {
                    MuleException exception = ExceptionHelper.getRootMuleException(wsException.getException());
                    // if the exception has a cause, then throw only the cause
                    if (exception.getCause() != null)
                    {
                        throw exception.getCause();
                    }
                    else
                    {
                        throw exception;
                    }
View Full Code Here

    private Throwable exception;

    public DefaultExceptionPayload(Throwable exception)
    {
        this.exception = exception;
        MuleException muleRoot = ExceptionHelper.getRootMuleException(exception);
        if (muleRoot != null)
        {
            message = muleRoot.getMessage();
            code = muleRoot.getExceptionCode();
            info = muleRoot.getInfo();
        }
        else
        {
            message = exception.getMessage();
        }
View Full Code Here

    {
        doShutdown();
        unregisterShutdownHook();

        Message msg = CoreMessages.fatalErrorWhileRunning();
        MuleException muleException = ExceptionHelper.getRootMuleException(e);
        int exitCode = 1;
        if (muleException != null)
        {
            logger.fatal(muleException.getDetailedMessage());
            exitCode = muleException.getExceptionCode();
        }
        else
        {
            logger.fatal(msg.toString() + " " + e.getMessage(), e);
        }
View Full Code Here

    static Log log = LogFactory.getLog(MuleAbstractTransportMessageHandlerTestCase.class);

    @Test
    public void testStartRethrowsMuleExceptionCorrectly() throws Exception
    {
        final MuleException someMuleException = mock(MuleException.class);
        AbstractTransportMessageHandler connectable = new AbstractTransportMessageHandler(createDummyEndpoint())
        {
            @Override
            protected void doStart() throws MuleException
            {
View Full Code Here

     * @param e the exception that caused the shutdown
     */
    public void shutdown(Throwable e)
    {
        Message msg = CoreMessages.fatalErrorWhileRunning();
        MuleException muleException = ExceptionHelper.getRootMuleException(e);
        if (muleException != null)
        {
            logger.fatal(muleException.getDetailedMessage());
        }
        else
        {
            logger.fatal(msg.toString() + " " + e.getMessage(), e);
        }
View Full Code Here

        assertTrue(router.isMatch(message));

        // exception to throw
        MuleSession session = (MuleSession)mockSession.proxy();
        MuleEvent eventToThrow = new DefaultMuleEvent(message, MessageExchangePattern.ONE_WAY, session);
        MuleException rex = new RoutingException(eventToThrow, endpoint1);
        mockendpoint1.expectAndThrow("process", RouterTestUtils.getArgListCheckerMuleEvent(), rex);
        mockendpoint2.expectAndThrow("process", RouterTestUtils.getArgListCheckerMuleEvent(), rex);
        MuleEvent result = null;
        try
        {
View Full Code Here

        assertTrue(router.isMatch(message));

        final MuleSession session = (MuleSession)mockSession.proxy();
        // exception to throw
        MuleEvent eventToThrow = new DefaultMuleEvent(message, MessageExchangePattern.ONE_WAY, session);
        MuleException rex = new RoutingException(eventToThrow, endpoint1);
        // 1st failure
        mockendpoint1.expectAndThrow("process", RouterTestUtils.getArgListCheckerMuleEvent(), rex);
        mockendpoint2.expectAndReturn("process", RouterTestUtils.getArgListCheckerMuleEvent(), event);
        MuleEvent actualResult = router.route(new OutboundRoutingTestEvent(message, session, muleContext));
        mockendpoint1.verify();
View Full Code Here

        assertTrue(router.isMatch(message));

        final MuleSession session = (MuleSession)mockSession.proxy();
        // exception to throw
        MuleEvent eventToThrow = new DefaultMuleEvent(message, MessageExchangePattern.ONE_WAY, session);
        MuleException rex = new RoutingException(eventToThrow, endpoint1);

        mockendpoint1.expectAndThrow("process", RouterTestUtils.getArgListCheckerMuleEvent(), rex);
        mockendpoint2.expectAndReturn("process", RouterTestUtils.getArgListCheckerMuleEvent(), event);
        MuleEvent actualResult = router.route(new OutboundRoutingTestEvent(message, session, muleContext));
        assertNull("Async call should not return any results.", actualResult);
View Full Code Here

TOP

Related Classes of org.mule.api.MuleException

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.