Package org.mule

Examples of org.mule.DefaultMuleEvent$NullInboundEndpoint


        assertEquals(MessageExchangePattern.REQUEST_RESPONSE, ep.getExchangePattern());
        assertEquals(2002, ep.getResponseTimeout());
        assertTrue(ep instanceof InboundEndpoint);

        // Test MuleEvent timeout proporgation
        MuleEvent event = new DefaultMuleEvent(new DefaultMuleMessage("hello", muleContext),
            (InboundEndpoint) ep, MuleTestUtils.getTestSession(muleContext));
        assertEquals(2002, event.getTimeout());

        ImmutableEndpoint ep2 = muleContext.getEndpointFactory().getInboundEndpoint(
            "test://hello?connector=testConnector1");

        event = new DefaultMuleEvent(new DefaultMuleMessage("hello", muleContext), (InboundEndpoint) ep2,
            MuleTestUtils.getTestSession(muleContext));
        // default event timeout set in the test config file
        assertEquals(1001, event.getTimeout());
    }
View Full Code Here


                        throw new AggregationException(events, null, e);
                    }
                }

                logger.debug("event payload is: " + buffer.toString());
                return new DefaultMuleEvent(new DefaultMuleMessage(buffer.toString(), muleContext), events.getMessageCollectionEvent());
            }
        };
    }
View Full Code Here

                }
            }
        }

        logger.info(LocaleMessage.lowestQuote(lowestQuote));
        return new DefaultMuleEvent(new DefaultMuleMessage(lowestQuote, event.getMessage(),
            event.getMuleContext()), event);
    }
View Full Code Here

                        logger.info("Message not accepted with filter: " + endpoint.getFilter());
                    }
                    return;
                }

                MuleEvent event = new DefaultMuleEvent(msg, endpoint.getExchangePattern(), session);
                endpoint.process(event);
            }
            catch (Exception e1)
            {
                // TODO MULE-863: If this is an error, do something better than this
View Full Code Here

                };
                router.setRoutes(getMessageProcessors());
                router.setMuleContext(muleContext);
               
                // Route the ExceptionMessage to the new router
                router.process(new DefaultMuleEvent(exceptionMessage, event));
            }
            catch (Exception e)
            {
                logFatal(event, e);
            }
View Full Code Here

                EndpointBuilder builder = new EndpointURIEndpointBuilder(endpoint);
                builder.setExchangePattern(MessageExchangePattern.REQUEST_RESPONSE);
                OutboundEndpoint syncEndpoint = muleContext.getRegistry()
                    .lookupEndpointFactory()
                    .getOutboundEndpoint(builder);
                MuleEvent dispatchEvent = new DefaultMuleEvent(message,
                    MessageExchangePattern.REQUEST_RESPONSE, session);
                MuleMessage result = null;
                MuleEvent resultEvent = syncEndpoint.process(dispatchEvent);
                if (resultEvent != null)
                {
                    result = resultEvent.getMessage();
                }

                if (result != null)
                {
                    byte[] response = result.getPayloadAsBytes();
                    Message responseMessage = new Message(response);
                    msgContext.setResponseMessage(responseMessage);

                }
                else
                {
                    logger
                        .warn("No response message was returned from synchronous call to: " + uri);
                }
                // remove temp file created for streaming
                if (payload instanceof File)
                {
                    ((File)payload).delete();
                }
            }
            else
            {
                MuleEvent dispatchEvent = new DefaultMuleEvent(message, MessageExchangePattern.ONE_WAY,
                    session);
                endpoint.process(dispatchEvent);
            }
        }
        catch (Exception e)
View Full Code Here

            {
                MuleEvent outboundEvent;
                if (event.getExchangePattern().hasResponse())
                {
                    // Copy of the inbound event for outbound phase
                    outboundEvent = new DefaultMuleEvent(new DefaultMuleMessage(event.getMessage()
                        .getPayload(), event.getMessage(), event.getMuleContext()), event);
                }
                else
                {
                    outboundEvent = event;
                }

                MuleEvent outboundResult = processNext(outboundEvent);

                if (outboundResult != null)
                {
                    event = outboundResult;
                }
                else if (service.getComponent() instanceof PassThroughComponent)
                {
                    // If there was no component, then we really want to return
                    // the response from the outbound router as the actual
                    // payload - even if it's null.
                    event = new DefaultMuleEvent(new DefaultMuleMessage(NullPayload.getInstance(),
                        event.getMessage(), service.getMuleContext()), event);
                }
            }
            else
            {
View Full Code Here

                        lowestQuote = loanQuote;
                    }
                }
            }
        }
        return new DefaultMuleEvent(new DefaultMuleMessage(lowestQuote, event.getMuleContext()), event);
    }
View Full Code Here

        props.put("bar", "mar");

        MuleMessage message = new DefaultMuleMessage(new FruitBowl(new Apple(), new Banana()), props,
            muleContext);

        MuleEvent resultEvent = flow.process(new DefaultMuleEvent(message, getTestInboundEndpoint(""),
            getTestSession(getTestService(), muleContext)));
        assertNotNull(resultEvent);
        assertNotNull(resultEvent.getMessage().getPayload());
        Object payload = resultEvent.getMessage().getPayload();
        assertFalse(payload.getClass().isArray());
View Full Code Here

        if (credentials != null)
        {
            message.setOutboundProperty(MuleProperties.MULE_USER_PROPERTY, "Plain " + credentials.getToken());
        }

        return new DefaultMuleEvent(message, endpoint.getExchangePattern(), session);
    }
View Full Code Here

TOP

Related Classes of org.mule.DefaultMuleEvent$NullInboundEndpoint

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.