Package org.mule.api.processor

Examples of org.mule.api.processor.MessageProcessor.process()


        MessageProcessor processor = lookupMessageProcessor(processorName, muleContext);

        try
        {
            return processor.process(new DefaultMuleEvent(messageToProcess, RequestContext.getEvent()))
                .getMessage();
        }
        catch (MuleException e)
        {
            throw new ExpressionRuntimeException(
View Full Code Here


                public MuleEvent process(MuleEvent event) throws MuleException
                {
                    // Need to initialize because message processor won't be managed by parent
                    MessageProcessor dynamicMessageProcessor = getReferencedFlow(muleContext.getExpressionManager()
                        .parse(refName, event), event.getFlowConstruct());
                    return dynamicMessageProcessor.process(event);
                }
            };
            if (dynamicReference instanceof Initialisable)
            {
                ((Initialisable) dynamicReference).initialise();
View Full Code Here

            return new MessageProcessor()
            {
                @Override
                public MuleEvent process(MuleEvent event) throws MuleException
                {
                    return referencedFlow.process(event);
                }
            };
        }
        else
        {
View Full Code Here

        }
        else
        {
            try
            {
                MuleEvent resultEvent = processor.process(event);
                if (resultEvent != null && !VoidMuleEvent.getInstance().equals(resultEvent))
                {
                    return resultEvent;
                }
                else
View Full Code Here

            if (processor == null)
            {
                throw new EndpointNotFoundException(
                    CoreMessages.noOutboundRouterSetOn(flowConstruct.getName()));
            }
            processor.process(new DefaultMuleEvent(message, RequestContext.getEvent()));
        }
    }

    /**
     * Depending on the session state this methods either Passes an event
View Full Code Here

    {
        DefaultMessageProcessorChainBuilder builder = new DefaultMessageProcessorChainBuilder();
        builder.chain(new TestMessageProcessor("1"), new TestMessageProcessor("2"), new TestMessageProcessor("3"));
        MessageProcessor mpChain = builder.build();
       
        result = mpChain.process(testOutboundEvent);
        assertEquals(TEST_MESSAGE + ":1:2:3", result.getMessage().getPayload());
    }

    @Test
    public void testNoProcessors() throws Exception
View Full Code Here

    public void testNoProcessors() throws Exception
    {
        DefaultMessageProcessorChainBuilder builder = new DefaultMessageProcessorChainBuilder();
        MessageProcessor mpChain = builder.build();
       
        result = mpChain.process(testOutboundEvent);
        assertEquals(TEST_MESSAGE, result.getMessage().getPayload());
    }

    protected OutboundEndpoint createOutboundEndpoint(Filter filter,
                                                      EndpointSecurityFilter securityFilter,
View Full Code Here

        MessageProcessor mp = messageProcessors.get(nextMessageProcessor);

        MuleEvent eventCopy = cloneEventForRouting(event, mp);
        try
        {
            return mp.process(eventCopy);
        }
        catch (MuleException me)
        {
            throw new RoutingFailedMessagingException(CoreMessages.createStaticMessage("Error processing event"), event, me);
        }
View Full Code Here

        muleContext.registerListener(listener);

        InboundEndpoint endpoint = createTestInboundEndpoint(null, null);
        MessageProcessor mp = new InboundNotificationMessageProcessor(endpoint);
        MuleEvent event = createTestInboundEvent(endpoint);
        mp.process(event);

        assertTrue(listener.latch.await(RECEIVE_TIMEOUT, TimeUnit.MILLISECONDS));
        assertEquals(EndpointMessageNotification.MESSAGE_RECEIVED, listener.messageNotification.getAction());
        assertEquals(endpoint.getEndpointURI().getUri().toString(),
            listener.messageNotification.getEndpoint());
View Full Code Here

        endpoint.setListener(inboundListener);
        requestEvent = createTestRequestEvent(endpoint);
        responseEvent = createTestResponseEvent(endpoint);

        MessageProcessor mpChain = ((AbstractEndpoint) endpoint).getMessageProcessorChain(requestEvent.getFlowConstruct());
        result = mpChain.process(requestEvent);
       
        Mockito.verify(reqTransformer, Mockito.times(1)).process(Mockito.any(MuleEvent.class));
        Mockito.verify(resTransformer, Mockito.times(1)).process(Mockito.any(MuleEvent.class));

        assertMessageSentSame(true);
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.