Package org.mule.api.processor

Examples of org.mule.api.processor.MessageProcessor


            throw new UnsupportedOperationException(
                "EventContext.dispatchEvent is only supported when flow constuct is a Service");
        }
        else
        {
            MessageProcessor processor = ((Service) flowConstruct).getOutboundMessageProcessor();
            if (processor == null)
            {
                throw new EndpointNotFoundException(
                    CoreMessages.noOutboundRouterSetOn(flowConstruct.getName()));
            }
            processor.process(new DefaultMuleEvent(message, RequestContext.getEvent()));
        }
    }
View Full Code Here


    {
        super.doSetUp();
        expressionManager = muleContext.getExpressionManager();
        RequestContext.setEvent(getTestEvent(""));

        muleContext.getRegistry().registerObject("processor", new MessageProcessor()
        {
            public MuleEvent process(MuleEvent event) throws MuleException
            {
                event.getMessage().setPayload(event.getMessageAsString() + "123");
                return event;
View Full Code Here

            throw new RoutePathNotFoundException(CoreMessages.noEndpointsForRouter(), event, null);
        }

        try
        {
            MessageProcessor ep = routes.get(0);
            EndpointURI newUri;

            if (ep instanceof OutboundEndpoint)
            {
                for (String propertyKey : message.getOutboundPropertyNames())
View Full Code Here

        Flow flowConstruct = muleContext.getRegistry().lookupObject("flowTest");
        assertNotNull(flowConstruct);
        assertTrue(flowConstruct.getMessageSource() instanceof InboundEndpoint);
        InboundEndpoint ep = ((InboundEndpoint)flowConstruct.getMessageSource());
        assertEquals(2, ep.getMessageProcessors().size());
        MessageProcessor mp = ep.getMessageProcessors().get(0);
        assertTrue(mp instanceof FeedSplitter);
        mp = ep.getMessageProcessors().get(1);
        assertTrue(mp instanceof MessageFilter);

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
View Full Code Here

   
    public void testInbound() throws Exception
    {
        CxfInboundMessageProcessor processor = createCxfMessageProcessor();
       
        MessageProcessor messageProcessor = new MessageProcessor()
        {
            public MuleEvent process(MuleEvent event) throws MuleException
            {
                payload = event.getMessage().getPayload();
                assertEquals("echo", payload);
View Full Code Here

    public void testOneWay() throws Exception
    {
        CxfInboundMessageProcessor processor = createCxfMessageProcessor();
       
        MessageProcessor messageProcessor = new MessageProcessor()
        {
            public MuleEvent process(MuleEvent event) throws MuleException
            {
                payload = event.getMessage().getPayload();
                assertEquals("echo", payload);
View Full Code Here

        final ResponseMessageProcessorAdapter ackResponseMessageProcessor = new ResponseMessageProcessorAdapter();
        ackResponseMessageProcessor.setListener(outboundMessageProcessor);
        ackResponseMessageProcessor.setProcessor(getExpressionTransformer(getName() + "-ack-expression",
            ackExpression));

        MessageProcessor validRouteMessageProcessor = ackResponseMessageProcessor;

        if (hasErrorExpression())
        {
            final ErrorExpressionTransformerMessageProcessor errorResponseMessageProcessor = new ErrorExpressionTransformerMessageProcessor(
                getExpressionTransformer(getName() + "-error-expression", errorExpression));
View Full Code Here

    @Override
    public void configureProcessors(Pipeline pipeline, MessageProcessorChainBuilder builder)
    {
        for (int i = 0; i < pipeline.getMessageProcessors().size(); i++)
        {
            MessageProcessor processor = pipeline.getMessageProcessors().get(i);

            builder.chain(createAsyncMessageProcessor(pipeline));

            if (processor instanceof MessageProcessor)
            {
View Full Code Here

    @Override
    public void configureProcessors(Pipeline pipeline, MessageProcessorChainBuilder builder)
    {
        for (int i = 0; i < pipeline.getMessageProcessors().size(); i++)
        {
            MessageProcessor processor = pipeline.getMessageProcessors().get(i);

            builder.chain(createAsyncMessageProcessor(pipeline));

            if (processor instanceof MessageProcessor)
            {
View Full Code Here

        Flow flowConstruct = muleContext.getRegistry().lookupObject("flowTest");
        assertNotNull(flowConstruct);
        assertTrue(flowConstruct.getMessageSource() instanceof InboundEndpoint);
        InboundEndpoint ep = ((InboundEndpoint)flowConstruct.getMessageSource());
        assertEquals(2, ep.getMessageProcessors().size());
        MessageProcessor mp = ep.getMessageProcessors().get(0);
        assertTrue(mp instanceof FeedSplitter);
        mp = ep.getMessageProcessors().get(1);
        assertTrue(mp instanceof MessageFilter);

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
View Full Code Here

TOP

Related Classes of org.mule.api.processor.MessageProcessor

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.