Examples of OutboundEndpoint


Examples of org.mule.api.endpoint.OutboundEndpoint

        exceptionListener = new TestExceptionListener();
    }

    public void testNoCatch() throws Exception
    {
        OutboundEndpoint endpoint = createTestOutboundEndpoint(null, null);
        InterceptingMessageProcessor mp = new ExceptionHandlingMessageProcessor();
        TestListener listener = new TestListener();
        mp.setListener(listener);

        MuleEvent event = createTestOutboundEvent();
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

        assertNull(exceptionListener.sensedException);
    }

    public void testCatchRuntimeExceptionSync() throws Exception
    {
        OutboundEndpoint endpoint = createTestOutboundEndpoint(null, null);
        InterceptingMessageProcessor mp = new ExceptionHandlingMessageProcessor();
        mp.setListener(new ExceptionThrowingMessageProcessr());

        MuleEvent event = createTestOutboundEvent(exceptionListener);
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

        assertNotNull(exceptionListener.sensedException);
    }

    public void testCatchRuntimeExceptionAsync() throws Exception
    {
        OutboundEndpoint endpoint = createTestOutboundEndpoint(null, null,
            MessageExchangePattern.ONE_WAY, null);
        InterceptingMessageProcessor mp = new ExceptionHandlingMessageProcessor();
        mp.setListener(new ExceptionThrowingMessageProcessr());

        MuleEvent event = createTestOutboundEvent(exceptionListener);
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

        assertNotNull(exceptionListener.sensedException);
    }

    public void testCatchDispatchExceptionSync() throws Exception
    {
        OutboundEndpoint endpoint = createTestOutboundEndpoint(null, null);
        InterceptingMessageProcessor mp = new ExceptionHandlingMessageProcessor();
        mp.setListener(new ExceptionThrowingMessageProcessr());

        MuleEvent event = createTestOutboundEvent(exceptionListener);
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

        assertNotNull(exceptionListener.sensedException);
    }

    public void testCatchDispatchExceptionAsync() throws Exception
    {
        OutboundEndpoint endpoint = createTestOutboundEndpoint(null, null,
            MessageExchangePattern.ONE_WAY, null);
        InterceptingMessageProcessor mp = new ExceptionHandlingMessageProcessor();
        mp.setListener(new ExceptionThrowingMessageProcessr());

        MuleEvent event = createTestOutboundEvent(exceptionListener);
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

        {
            throw new RoutingException(CoreMessages.noCatchAllEndpointSet(), event, getEndpoint());
        }
        try
        {
            OutboundEndpoint endpoint = getEndpoint();
            if (sendTransformed && endpoint.getTransformers() != null)
            {
                event.getMessage().applyTransformers(event, endpoint.getTransformers());
            }

            MuleEvent result = endpoint.process(event);
            if (statistics != null && statistics.isEnabled())
            {
                statistics.incrementRoutedMessage(getEndpoint());
            }
            return result;
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

    public void testPermanentDeliveryFailureDLQ() throws Exception
    {
        targetMessageProcessor.setNumberOfFailuresToSimulate(Integer.MAX_VALUE);
        EndpointBuilder dlqEndpointBuilder = mock(EndpointBuilder.class);
        OutboundEndpoint dlqEndpoint = mock(OutboundEndpoint.class);
        when(dlqEndpointBuilder.buildOutboundEndpoint()).thenReturn(dlqEndpoint);
        untilSuccessful.setDlqEndpoint(dlqEndpointBuilder);
        untilSuccessful.initialise();
        untilSuccessful.start();
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

            MessageProcessor mp = routes.get(index);
            if (!(mp instanceof ImmutableEndpoint))
            {
                return routes.get(index);
            }
            OutboundEndpoint ep = (OutboundEndpoint) mp;
            String uri = ep.getAddress();

            if (logger.isDebugEnabled())
            {
                logger.debug("Uri before parsing is: " + uri);
            }

            Map<String, Object> props = new HashMap<String, Object>();
            // Also add the endpoint properties so that users can set fallback values
            // when the property is not set on the event
            props.putAll(ep.getProperties());
            for (String propertyKey : message.getOutboundPropertyNames())
            {
                Object value = message.getOutboundProperty(propertyKey);
                props.put(propertyKey, value);
            }

            propagateMagicProperties(message, message);

            if (!parser.isContainsTemplate(uri))
            {
                logger.debug("Uri does not contain template(s)");
                return ep;
            }
            else
            {

                String newUriString = parser.parse(props, uri);
                if (parser.isContainsTemplate(newUriString))
                {
                    newUriString = this.getMuleContext().getExpressionManager().parse(newUriString, message, true);
                }
                if (logger.isDebugEnabled())
                {
                    logger.debug("Uri after parsing is: " + uri);
                }
                try
                {
                    EndpointURI newUri = new MuleEndpointURI(newUriString, muleContext);
                    EndpointURI endpointURI = ep.getEndpointURI();
                    if (endpointURI != null && !newUri.getScheme().equalsIgnoreCase(endpointURI.getScheme()))
                    {
                        throw new CouldNotRouteOutboundMessageException(
                            CoreMessages.schemeCannotChangeForRouter(ep.getEndpointURI().getScheme(),
                                newUri.getScheme()), event, ep);
                    }
                    newUri.initialise();

                    return new DynamicURIOutboundEndpoint(ep, newUri);
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

        }

        //TODO MULE-4952 what is the strategy here for proxy components?
        endpointBuilder.setExchangePattern(MessageExchangePattern.REQUEST_RESPONSE);
        OutboundEndpoint endpoint = endpointBuilder.buildOutboundEndpoint();
       
        MuleEvent responseEvent = endpoint.process(event);

        if (responseEvent != null)
        {
            return responseEvent.getMessage();
        }
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

public class ExceptionListenerTestCase extends AbstractMuleTestCase
{
    public void testAddGoodEndpoint() throws Exception
    {
        AbstractExceptionStrategy router = new DefaultMessagingExceptionStrategy(muleContext, true);
        OutboundEndpoint endpoint = getTestOutboundEndpoint("test");
        router.addEndpoint(endpoint);
        assertNotNull(router.getMessageProcessors());
        assertTrue(router.getMessageProcessors().contains(endpoint));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.