Package org.mule.message

Examples of org.mule.message.DefaultExceptionPayload


        message.setCorrelationSequence(1);
        message.setCorrelationGroupSize(2);
        message.setReplyTo("foo");
        message.setEncoding("UTF-8");
        Exception e = new Exception("dummy");
        message.setExceptionPayload(new DefaultExceptionPayload(e));

        //no expression
        Object result = eval.evaluate(null, message);
        assertNotNull(result);
        assertEquals(message, result);
View Full Code Here


        message.setCorrelationSequence(1);
        message.setCorrelationGroupSize(2);
        message.setReplyTo("foo");
        message.setEncoding("UTF-8");
        Exception e = new Exception("dummy");
        message.setExceptionPayload(new DefaultExceptionPayload(e));


        assertEquals(message.getUniqueId(), muleContext.getExpressionManager().evaluate("#[mule:message.id]", message));
        assertEquals(message.getUniqueId(), muleContext.getExpressionManager().evaluate("#[mule:message.correlationId]", message));
        assertEquals(new Integer(1), muleContext.getExpressionManager().evaluate("#[mule:message.correlationSequence]", message));
View Full Code Here

                    throw new DefaultMuleException("Saw " + rejectIfMatches);
                }
                else if (payload.toLowerCase().indexOf(rejectIfMatches) >= 0)
                {
                    msg = new DefaultMuleMessage(null, muleContext);
                    msg.setExceptionPayload(new DefaultExceptionPayload(new Exception()));
                }
                else
                {
                    msg = new DefaultMuleMessage("No " + rejectIfMatches, muleContext);
                }
View Full Code Here

            }
            catch (Exception e)
            {
                exPayload = "Invalid status code: " + statusCode;
            }
            message.setExceptionPayload(new DefaultExceptionPayload(new HttpException(exPayload)));
        }
        else
        {
            message.setPayload(payload);
        }
View Full Code Here

        message.setCorrelationSequence(1);
        message.setCorrelationGroupSize(2);
        message.setReplyTo("foo");
        message.setEncoding("UTF-8");
        Exception e = new Exception("dummy");
        message.setExceptionPayload(new DefaultExceptionPayload(e));

        //no expression
        Object result = eval.evaluate(null, message);
        assertNotNull(result);
        assertEquals(message, result);
View Full Code Here

        message.setCorrelationSequence(1);
        message.setCorrelationGroupSize(2);
        message.setReplyTo("foo");
        message.setEncoding("UTF-8");
        Exception e = new Exception("dummy");
        message.setExceptionPayload(new DefaultExceptionPayload(e));


        assertEquals(message.getUniqueId(), muleContext.getExpressionManager().evaluate("#[message:id]", message));
        assertEquals(message.getUniqueId(), muleContext.getExpressionManager().evaluate("#[message:correlationId]", message));
        assertEquals(new Integer(1), muleContext.getExpressionManager().evaluate("#[message:correlationSequence]", message));
View Full Code Here

       }
        catch (Throwable e)
        {
            //Make all exceptions go through the CallException handler
            reply = new DefaultMuleMessage(NullPayload.getInstance(), muleContext);
            reply.setExceptionPayload(new DefaultExceptionPayload(e));
            return new MuleResponseMessage(reply);
        }
        return new MuleResponseMessage(replyEvent.getMessage());
    }
View Full Code Here

                }
            }
            catch (final MuleException me)
            {
                logger.error(me);
                result.getMessage().setExceptionPayload(new DefaultExceptionPayload(me));
            }

            return result;
        }
View Full Code Here

    {
        //TODO should this really be read/write
        response.setStatusCode(String.valueOf(status));
        if(status >= 400)
        {
            response.getMessage().setExceptionPayload(new DefaultExceptionPayload(new Exception("Mock Http Error")));
        }
    }
View Full Code Here

        boolean releaseConn = false;
        try
        {
            httpMethod = execute(event, httpMethod);

            DefaultExceptionPayload ep = null;

            if (returnException(event, httpMethod))
            {
                ep = new DefaultExceptionPayload(new DispatchException(event, getEndpoint(),
                        new HttpResponseException(httpMethod.getStatusText(), httpMethod.getStatusCode())));
            }
            else if (httpMethod.getStatusCode() >= REDIRECT_STATUS_CODE_RANGE_START)
            {
                try
                {
                    return handleRedirect(httpMethod, event);
                }
                catch (Exception e)
                {
                    ep = new DefaultExceptionPayload(new DispatchException(event, getEndpoint(), e));
                    return getResponseFromMethod(httpMethod, ep);
                }
            }
            releaseConn = httpMethod.getResponseBodyAsStream() == null;
            return getResponseFromMethod(httpMethod, ep);
View Full Code Here

TOP

Related Classes of org.mule.message.DefaultExceptionPayload

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.