Package org.mule.api

Examples of org.mule.api.MessagingException


        try
        {
            String errorMessage = message + ": " + exception.getMessage();
            if (exception instanceof MessagingException && ((MessagingException) exception).getEvent() != null)
            {
                MessagingException me = (MessagingException) exception;
                writeErrorResponseFromMessage(response, me.getEvent().getMessage(), code, errorMessage);
            }
            else
            {
                response.sendError(code, errorMessage);
            }
View Full Code Here


            if (iterator.hasNext()
                && (isMatchAll() || ((outboundRouter instanceof TransformingMatchable) && ((TransformingMatchable) outboundRouter).isTransformBeforeMatch())))
            {
                if (((DefaultMuleMessage) message).isConsumable())
                {
                    throw new MessagingException(CoreMessages.cannotCopyStreamPayload(message.getPayload()
                        .getClass()
                        .getName()), event, this);
                }
                outboundRouterMessage = new DefaultMuleMessage(message.getPayload(), message, muleContext);
            }
View Full Code Here

            }
            return messages;
        }
        catch (TransformerException e)
        {
            throw new MessagingException(e.getI18nMessage(), event, e, this);
        }
    }
View Full Code Here

    @Test
    public void muleException() throws Exception
    {
        MuleMessage message = new DefaultMuleMessage("", muleContext);
        RuntimeException rte = new RuntimeException();
        MessagingException me = new MessagingException(CoreMessages.version(), message, rte);
        message.setExceptionPayload(new DefaultExceptionPayload(me));
        assertEquals(me, muleContext.getExpressionManager().evaluate("#[groovy:exception]", message));
    }
View Full Code Here

     */
    public static void validateMessageIsNotConsumable(MuleEvent event, MuleMessage message) throws MessagingException
    {
        if (((DefaultMuleMessage) message).isConsumable())
        {
            throw new MessagingException(
                    CoreMessages.cannotCopyStreamPayload(message.getPayload().getClass().getName()),
                    event);
        }
    }
View Full Code Here

    protected static void assertNonConsumableMessage(MuleEvent event, MuleMessage message) throws MessagingException
    {
        DefaultMuleMessage defaultMuleMessage = (DefaultMuleMessage) message;
        if (defaultMuleMessage.isConsumable())
        {
            throw new MessagingException(CoreMessages.cannotCopyStreamPayload(defaultMuleMessage.getPayload().getClass().getName()), event);
        }
    }
View Full Code Here

                {
                    ((DefaultMuleMessage)message).addInboundAttachment(attachment.getId(), attachment.getDataHandler());
                }
                catch (Exception e)
                {
                    throw new MessagingException(CoreMessages.createStaticMessage("Could not set inbound attachment %s",
                                                                                  attachment.getId()), event, e);
                }
            }
        }
View Full Code Here

                event.setStopFurtherProcessing(true);
                return event;
            }
            catch (final Exception e)
            {
                throw new MessagingException(
                    MessageFactory.createStaticMessage("Impossible to retrieve WSDL for proxied service"),
                    event, e, this);
            }
        }
View Full Code Here

    public static class ExceptionThrowingProcessor implements MessageProcessor
    {
        @Override
        public MuleEvent process(MuleEvent event) throws MuleException
        {
            throw new MessagingException(event,new FunctionalTestException());
        }
View Full Code Here

                resultEvent = createResultEvent(event, result);
            }
        }
        catch (Exception e)
        {
            throw new MessagingException(CoreMessages.failedToInvoke(object.toString()), event, e, this);
        }
        return resultEvent;
    }
View Full Code Here

TOP

Related Classes of org.mule.api.MessagingException

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.