Package org.mule.api.processor

Examples of org.mule.api.processor.MessageProcessor


        builder.setOperation("echo");
        builder.setMuleContext(muleContext);
       
        CxfOutboundMessageProcessor processor = builder.build();
       
        MessageProcessor messageProcessor = new MessageProcessor()
        {
            public MuleEvent process(MuleEvent event) throws MuleException
            {
                payload = event.getMessage().getPayload();
                try
View Full Code Here


    @Test
    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

    @Test
    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

        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 && !VoidMuleEvent.getInstance().equals(resultEvent))
                {
                    return resultEvent;
                }
                else
View Full Code Here

        MuleEvent exceptionHandlingResult = exceptionHandlingResult = catchMessagingExceptionStrategy.handleException(mockException, mockMuleEvent);
    }

    private MessageProcessor createChagingEventMessageProcessor(final MuleEvent lastEventCreated)
    {
        return new MessageProcessor()
        {
            @Override
            public MuleEvent process(MuleEvent event) throws MuleException
            {
                return lastEventCreated;
View Full Code Here

        };
    }

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

        };
    }

    private MessageProcessor createSetStringMessageProcessor(final String appendText)
    {
        return new MessageProcessor()
        {
            @Override
            public MuleEvent process(MuleEvent event) throws MuleException
            {
                event.getMessage().setPayload(appendText);
View Full Code Here

    @Override
    public MessageProcessor createMessageProcessorChain(FlowConstruct flowContruct) throws MuleException
    {
        EndpointMessageProcessorChainFactory factory = getMessageProcessorsFactory();
        MessageProcessor processorChain = factory.createInboundMessageProcessorChain(this, flowConstruct,
            listener);
        if (processorChain instanceof MuleContextAware)
        {
            ((MuleContextAware) processorChain).setMuleContext(getMuleContext());
        }
        if (processorChain instanceof FlowConstructAware)
        {
            ((FlowConstructAware) processorChain).setFlowConstruct(flowContruct);
        }
        if (processorChain instanceof Initialisable)
        {
            ((Initialisable) processorChain).initialise();
        }
        MessageProcessor polledMp = getPolledMessageProcessor();
        if (polledMp instanceof MuleContextAware)
        {
            ((MuleContextAware) polledMp).setMuleContext(getMuleContext());
        }
        if (polledMp instanceof FlowConstructAware)
View Full Code Here

    @Override
    protected MessageProcessor createMessageProcessorChain(FlowConstruct flowContruct) throws MuleException
    {
        EndpointMessageProcessorChainFactory factory = getMessageProcessorsFactory();
        MessageProcessor chain = factory.createOutboundMessageProcessorChain(this,
            ((AbstractConnector) getConnector()).createDispatcherMessageProcessor(this));

        if (chain instanceof MuleContextAware)
        {
            ((MuleContextAware) chain).setMuleContext(getMuleContext());
View Full Code Here

        });
    }

    protected void configurePostProcessors(MessageProcessorChainBuilder builder) throws MuleException
    {
        builder.chain(new MessageProcessor()
        {
            @Override
            public MuleEvent process(MuleEvent event) throws MuleException
            {
                muleContext.getNotificationManager().fireNotification(
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.