Package org.mule.api

Examples of org.mule.api.DefaultMuleException


        {
            sfb = createServerFactory();
        }
        catch (Exception e)
        {
            throw new DefaultMuleException(e);
        }

        // The binding - i.e. SOAP, XML, HTTP Binding, etc
        if (bindingId != null)
        {
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)));
            }

            // 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(inboundEndpoint);
            // 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.getFlowConstruct(),
                context.getSession());
            event = RequestContext.setEvent(event);

            if (context.getExchangePattern().hasResponse())
            {
                MuleEvent resultEvent = ((MessageProcessor) flowConstruct).process(event);
                result = resultEvent == null || VoidMuleEvent.getInstance().equals(resultEvent)
                                                                                               ? 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

     */
    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

    @Test
    public void closesCloseableElementsBesidesOfExceptions() throws Exception
    {
        Closeable closeable1 = mock(Closeable.class);
        doThrow(new DefaultMuleException("Error")).when(closeable1).close();
        closeableMap.put(NEW_KEY_1, closeable1);

        Closeable closeable2 = mock(Closeable.class);
        closeableMap.put(NEW_KEY_2, closeable2);
View Full Code Here

        {
            throw e;
        }
        catch (Exception e)
        {
            throw new DefaultMuleException(CoreMessages.createStaticMessage("Flow execution exception"),e);
        }
        finally
        {
            RequestContext.setEvent(event);
            event.getMessage().release();
View Full Code Here

        return new MessageProcessor()
        {
            @Override
            public MuleEvent process(MuleEvent event) throws MuleException
            {
                throw new DefaultMuleException(mockException);
            }
        };
    }
View Full Code Here

                IOUtils.copy(in, baos);
                return inboundTransformer.transform(baos.toByteArray());
            }
            catch (IOException e)
            {
                throw new DefaultMuleException(CoreMessages.failedToReadPayload(), e);
            }
        }
    }
View Full Code Here

    @Test(expected = NotSerializableException.class)
    public void failsToGenerateKeyWhenCannotReadPayload() throws Exception
    {
        MuleEvent event = mock(MuleEvent.class);
        when(event.getMessageAsBytes()).thenThrow(new DefaultMuleException("Fail"));
        keyGenerator.generateKey(event);
    }
View Full Code Here

                    }
                    phaseResultNotifier.phaseSuccessfully();
                }
                catch (Exception e)
                {
                    MuleException me = new DefaultMuleException(e);
                    try
                    {
                        flowProcessingPhaseTemplate.afterFailureProcessingFlow(me);
                    }
                    catch (MuleException e1)
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.