Package org.mule.api

Examples of org.mule.api.MuleEvent


        {
            return event;
        }
        else
        {
            MuleEvent copy = (MuleEvent) ((ThreadSafeAccess) event).newThreadCopy();
            MuleEvent result = responseProcessor.process(event);
            if (result == null)
            {
                // If <response> returns null then it acts as an implicit branch like in flows, the different
                // here is that what's next, it's not another message processor that follows this one in the
                // configuration file but rather the response phase of the inbound endpoint, or optionally
View Full Code Here


            MessageExchangePattern.REQUEST_RESPONSE, null);
        InterceptingMessageProcessor mp = new SecurityFilterMessageProcessor(securityFilter);
        TestListener listner = new TestListener();
        mp.setListener(listner);

        MuleEvent inEvent = createTestInboundEvent(endpoint);
        MuleEvent resultEvent = mp.process(inEvent);
        assertNotNull(listner.sensedEvent);
        assertSame(inEvent, listner.sensedEvent);
        assertEquals(inEvent, resultEvent);

    }
View Full Code Here

            MessageExchangePattern.REQUEST_RESPONSE, null);
        InterceptingMessageProcessor mp = new SecurityFilterMessageProcessor(securityFilter);
        TestListener listner = new TestListener();
        mp.setListener(listner);

        MuleEvent inEvent = createTestInboundEvent(endpoint);

        // Need event in RequestContext :-(
        RequestContext.setEvent(inEvent);

        try
        {
            MuleEvent resultEvent = mp.process(inEvent);
            fail("Exception expected");
        }
        catch (TestSecurityFilter.StaticMessageUnauthorisedException e)
        {
            // expected
View Full Code Here

    public void handleException(Exception e, RollbackMethod rollbackMethod)
    {
        if (e instanceof MessagingException)
        {
            MuleEvent event = ((MessagingException) e).getEvent();
            event.getFlowConstruct().getExceptionListener().handleException(e, event, rollbackMethod);
        }
        else
        {
            getExceptionListener().handleException(e, rollbackMethod);
        }
View Full Code Here

            {
                // note that we're firing event for the next in chain, not this MP
                fireNotification(event.getFlowConstruct(), event, next,
                    MessageProcessorNotification.MESSAGE_PROCESSOR_PRE_INVOKE);
            }
            final MuleEvent result;
            try
            {
                result = next.process(event);
            }
            catch (MuleException e)
View Full Code Here

        messageProcessor = createAsyncInterceptingMessageProcessor(target);
    }

    public void testProcessOneWay() throws Exception
    {
        MuleEvent event = getTestEvent(TEST_MESSAGE, getTestInboundEndpoint(MessageExchangePattern.ONE_WAY));

        MuleEvent result = messageProcessor.process(event);

        latch.await(10000, TimeUnit.MILLISECONDS);
        assertNotNull(target.sensedEvent);
        // Event is not the same because it gets copied in
        // AbstractMuleEventWork#run()
View Full Code Here

        assertNull(exceptionThrown);
    }

    public void testProcessRequestResponse() throws Exception
    {
        MuleEvent event = getTestEvent(TEST_MESSAGE, getTestInboundEndpoint(MessageExchangePattern.ONE_WAY));

        assertAsync(messageProcessor, event);
    }
View Full Code Here

        assertAsync(messageProcessor, event);
    }

    public void testProcessOneWayWithTx() throws Exception
    {
        MuleEvent event = getTestEvent(TEST_MESSAGE,
            getTestTransactedInboundEndpoint(MessageExchangePattern.ONE_WAY));
        Transaction transaction = new TestTransaction(muleContext);
        TransactionCoordination.getInstance().bindTransaction(transaction);

        try
View Full Code Here

        }
    }

    public void testProcessRequestResponseWithTx() throws Exception
    {
        MuleEvent event = getTestEvent(TEST_MESSAGE,
            getTestTransactedInboundEndpoint(MessageExchangePattern.REQUEST_RESPONSE));
        Transaction transaction = new TestTransaction(muleContext);
        TransactionCoordination.getInstance().bindTransaction(transaction);

        try
View Full Code Here

        }
    }

    protected void assertSync(MessageProcessor processor, MuleEvent event) throws MuleException
    {
        MuleEvent result = processor.process(event);

        assertSame(event, target.sensedEvent);
        assertSame(event, result);
    }
View Full Code Here

TOP

Related Classes of org.mule.api.MuleEvent

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.