Package org.mule.api

Examples of org.mule.api.DefaultMuleException


                p.load(url.openStream());
                extensions.add(p);
            }
            catch (Exception ex)
            {
                throw new DefaultMuleException("Error loading Mule core extensions", ex);
            }
        }

        for (Properties extProps : extensions)
        {
            for (Map.Entry entry : extProps.entrySet())
            {
                String extName = (String) entry.getKey();
                String extClass = (String) entry.getValue();
                try
                {
                    MuleCoreExtension extension = (MuleCoreExtension) ClassUtils.instanciateClass(extClass);
                    extension.initialise();
                    coreExtensions.put(extension.getClass(), extension);
                }
                catch (Exception ex)
                {
                    throw new DefaultMuleException("Error starting Mule core extension " + extName, ex);
                }
            }
        }
    }
View Full Code Here


                return sendToDestination(event);
            }
        }
        catch (IOException e)
        {
            throw new DefaultMuleException(e);
        }
    }
View Full Code Here

     */
    protected Class<?> getTargetClass(Service service) throws MuleException, ClassNotFoundException
    {
        if (service == null)
        {
            throw new DefaultMuleException(CxfMessages.serviceClassRequiredWithPassThrough());
        }

        Component component = service.getComponent();
        if (!(component instanceof JavaComponent))
        {
            throw new DefaultMuleException(CxfMessages.serviceClassRequiredWithPassThrough());
        }

        try
        {
            return ((JavaComponent) component).getObjectType();
View Full Code Here

        {
            client = createClient();
        }
        catch (Exception e)
        {
            throw new DefaultMuleException(e);
        }
       
        addInterceptors(client.getInInterceptors(), inInterceptors);
        addInterceptors(client.getInFaultInterceptors(), inFaultInterceptors);
        addInterceptors(client.getOutInterceptors(), outInterceptors);
View Full Code Here

        {
            result = receiveAction(action, context);
        }
        else
        {
            result = handleException(null, new DefaultMuleException(
                CoreMessages.eventTypeNotRecognised("RemoteDispatcherNotification:" + action.getAction())));
        }
        return result;
    }
View Full Code Here

        if (destComponent != null)
        {
            Object flowConstruct = muleContext.getRegistry().lookupObject(destComponent);
            if (!(flowConstruct instanceof FlowConstruct && flowConstruct instanceof MessageProcessor))
            {
                return handleException(null, new DefaultMuleException(ClientMessages.noSuchFlowConstruct(destComponent)));
            }
            MuleSession session = new DefaultMuleSession((FlowConstruct) flowConstruct, muleContext);
            // Need to do this otherise when the event is invoked the
            // transformer associated with the Mule Admin queue will be invoked, but
            // the message will not be of expected type

            EndpointBuilder builder = new EndpointURIEndpointBuilder(RequestContext.getEvent().getEndpoint());
            // TODO - is this correct? it stops any other transformer from being set
            builder.setTransformers(new LinkedList());
            InboundEndpoint ep = muleContext.getEndpointFactory().getInboundEndpoint(builder);
            MuleEvent event = new DefaultMuleEvent(action.getMessage(), ep, context.getSession());
            event = RequestContext.setEvent(event);

            if (context.getExchangePattern().hasResponse())
            {
                MuleEvent resultEvent = ((MessageProcessor) flowConstruct).process(event);
                result = resultEvent == null ? null : resultEvent.getMessage();
                if (result == null)
                {
                    return null;
                }
                else
                {
                    ByteArrayOutputStream out = new ByteArrayOutputStream();
                    wireFormat.write(out, result, getEncoding());
                    return out.toByteArray();
                }
            }
            else
            {
                ((MessageProcessor) flowConstruct).process(event);
                return null;
            }
        }
        else
        {
            return handleException(result, new DefaultMuleException(
                CoreMessages.couldNotDetermineDestinationComponentFromEndpoint(endpoint)));
        }
    }
View Full Code Here

        code = ExceptionHelper.getErrorMapping("http", UnauthorisedException.class);
        assertEquals("401", code);

        code = ExceptionHelper.getErrorMapping("blah", DefaultMuleException.class);
        assertEquals(
            String.valueOf(new DefaultMuleException(MessageFactory.createStaticMessage("test")).getExceptionCode()), code);

    }
View Full Code Here

    {

        JMSException e = new JMSException("Jms error", "1234");
        e.setLinkedException(new IOException("blah"));

        return new DefaultMuleException(MessageFactory.createStaticMessage("foo"), new DefaultMuleException(
            MessageFactory.createStaticMessage("bar"), e));
    }
View Full Code Here

        {
            targetDir += "/";
        }

        ObjectToXml trans = new ObjectToXml();
        DefaultMuleException exception = new DefaultMuleException(MessageFactory.createStaticMessage("Some default exception"));
        FatalException fatal = new FatalException(MessageFactory.createStaticMessage("Some fatal exception"),
            new IOException("Some IO exception"));
        BusinessException business = new BusinessException("Some business exception");

        ExceptionBean bean = new ExceptionBean(exception);
View Full Code Here

                return sendToDestination(event);
            }
        }
        catch (IOException e)
        {
            throw new DefaultMuleException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.mule.api.DefaultMuleException

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.