Package org.mule.api

Examples of org.mule.api.MessagingException


                        Thread.sleep(500);
                    }
                }
                catch (InterruptedException e)
                {
                    throw new MessagingException(
                        CoreMessages.interruptedWaitingForPaused(getStartableName(startable)), event, e);
                }
            }
            return processNext(event);
        }
View Full Code Here


                {
                    MimeType mt = new MimeType(contentType);
                    String messageMimeType = mt.getPrimaryType() + "/" + mt.getSubType();
                    if (!messageMimeType.equals(endpointMimeType))
                    {
                        throw new MessagingException(
                            CoreMessages.unexpectedMIMEType(messageMimeType, endpointMimeType), event);
                    }
                }
                catch (MimeTypeParseException ex)
                {
                    throw new MessagingException(CoreMessages.illegalMIMEType(contentType), event, ex);
                }
            }
        }

        return event;
View Full Code Here

                    return target.process(event);
                }
            }
            catch (MuleException e)
            {
                throw new MessagingException(e.getI18nMessage(), theEvent, e);
            }
        }
        //TODO
        throw new RuntimeException("Event not processed");
    }
View Full Code Here

     */
    protected abstract MuleEvent doProcess(MuleEvent event) throws Exception;

    private void handleException(MuleEvent event, Throwable e) throws MuleException
    {
        throw new MessagingException(CoreMessages.failedToInvoke(this.operationName), event, e);
    }
View Full Code Here

            return processNext(muleEvent);
        }
        catch (SQLException e)
        {
            throw new MessagingException(muleEvent, e);
        }
        finally
        {
            if (connection != null && mustCloseConnection())
            {
View Full Code Here

    public static class ThrowExceptionTransformer extends AbstractTransformer
    {
        @Override
        public MuleEvent process(MuleEvent event) throws MuleException
        {
            throw new MessagingException(event, new Throwable("Error transforming message"));
        }
View Full Code Here

            }
        }

        if (method == null)
        {
            throw new MessagingException(CxfMessages.noOperationWasFoundOrSpecified(), event, this);
        }
        return method;
    }
View Full Code Here

                {
                    message.setPayload(message.getPayload(String.class));
                }
                catch (Exception e)
                {
                    throw new MessagingException(
                        MessageFactory.createStaticMessage(String.format(
                            "event can't be persisted because payload of class %s couldn't be consumed into a string",
                            message.getPayload().getClass().getCanonicalName())), event, e);
                }
            }
        }

        if (!(message.getPayload() instanceof Serializable))
        {
            throw new MessagingException(
                MessageFactory.createStaticMessage(String.format(
                    "In order to perform the OAuth authorization dance the mule event needs to be stored in the object store. However, the message has a payload of class %s which is not serializable.",
                    message.getPayload().getClass().getCanonicalName())), event);
        }

        String key = this.buildAuthorizationEventKey(event.getId());
        synchronized (event)
        {
            try
            {
                if (this.accessTokenObjectStore.contains(key))
                {
                    this.accessTokenObjectStore.remove(key);
                }
                this.accessTokenObjectStore.store(key, event);
            }
            catch (ObjectStoreException e)
            {
                throw new MessagingException(
                    MessageFactory.createStaticMessage("Exception was thrown when trying to store the message into object store. Please check that all message properties are serializable"),
                    event, e);
            }
        }
    }
View Full Code Here

            }
        }
        catch (ObjectStoreException e)
        {
            // TODO improve this
            throw new MessagingException(null, e);
        }
    }
View Full Code Here

        public MuleEvent handleException(Exception ex, MuleEvent event)
        {
            doHandleException(ex, event);
            DefaultMuleMessage message = new DefaultMuleMessage(NullPayload.getInstance(), muleContext);
            message.setExceptionPayload(
                new DefaultExceptionPayload(new MessagingException(event, new RuntimeException("Bad news!"))));
            return new DefaultMuleEvent(message, event);
        }
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.