Package org.mule.api.processor

Examples of org.mule.api.processor.MessageProcessor


        if (processorArgExpression != null)
        {
            messageToProcess = evaluateProcessorArgument(message, processorArgExpression);
        }

        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


    protected void doSetUp() throws Exception
    {
        super.doSetUp();
        mapSplitter = new MapSplitter();
        mapSplitter.setMuleContext(muleContext);
        mapSplitter.setListener(new MessageProcessor()
        {
            public MuleEvent process(MuleEvent event) throws MuleException
            {
                splitPayloads.add(event.getMessageAsString());
                splitKeyProperties.add((String) event.getMessage().getProperty(MapSplitter.MAP_ENTRY_KEY,
View Full Code Here

        if (routes == null || routes.size() == 0)
        {
            throw new RoutePathNotFoundException(CoreMessages.noEndpointsForRouter(), event, null);
        }

        MessageProcessor ep = getRoute(0, event);

        try
        {
            result = sendRequest(event, message, ep, true);
        }
View Full Code Here

            return routes.get(index);
        }
        else
        {
            MuleMessage message = event.getMessage();
            MessageProcessor mp = routes.get(index);
            if (!(mp instanceof ImmutableEndpoint))
            {
                return routes.get(index);
            }
            OutboundEndpoint ep = (OutboundEndpoint) mp;
View Full Code Here

        if (modulo < 0)
        {
            throw new CouldNotRouteOutboundMessageException(event, this);
        }
       
        MessageProcessor mp = routes.get(modulo);
        try
        {
            return mp.process(event);
        }
        catch (MuleException ex)
        {
            throw new RoutingException(event, this, ex);
        }
View Full Code Here

        if (!(event.getFlowConstruct() instanceof Service))
        {
            throw new UnsupportedOperationException("ForwardingConsumer is only supported with Service");
        }

        MessageProcessor processor = ((Service) event.getFlowConstruct()).getOutboundMessageProcessor();

        // Set the stopFurtherProcessing flag to true to inform the
        // DefaultInboundRouterCollection not to route these events to the service
        event.setStopFurtherProcessing(true);

        if (processor == null)
        {
            logger.debug("Descriptor has no outbound router configured to forward to, continuing with normal processing");
            return event;
        }
        else
        {
            try
            {
                MuleEvent resultEvent = processor.process(event);
                if (resultEvent != null)
                {
                    return resultEvent;
                }
                else
View Full Code Here

        assertEquals(EXCEPTION_SEEN, getPayload(fs, session, "ABCDEFGHI"));
    }

    public void testFailureExpression() throws Exception
    {
        MessageProcessor intSetter = new MessageProcessor()
        {
            @Override
            public MuleEvent process(MuleEvent event) throws MuleException
            {
                event.getMessage().setPayload(Integer.valueOf(1));
View Full Code Here

        assertEquals("abc", fs.process(getTestEvent("")).getMessageAsString());
    }

    public void testRouteReturnsNullEvent() throws Exception
    {
        MessageProcessor nullReturningMp = new MessageProcessor()
        {
            @Override
            public MuleEvent process(MuleEvent event) throws MuleException
            {
                return null;
View Full Code Here

        assertNull(fs.process(getTestEvent("")));
    }

    public void testRouteReturnsNullMessage() throws Exception
    {
        MessageProcessor nullEventMp = new MessageProcessor()
        {
            @Override
            public MuleEvent process(MuleEvent event) throws MuleException
            {
                return new DefaultMuleEvent(null, event);
View Full Code Here

        }
    }

    public void testProcessingIsForcedOnSameThread() throws Exception
    {
        MessageProcessor checkForceSyncFlag = new MessageProcessor()
        {
            @Override
            public MuleEvent process(MuleEvent event) throws MuleException
            {
                MuleMessage message = event.getMessage();
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.