Package org.mule.api

Examples of org.mule.api.MuleEvent


        SOAPMessage msg = msgContext.getMessage();
        if (msg == null)
        {
            return;
        }
        MuleEvent event = (MuleEvent)msgContext.getProperty(MuleProperties.MULE_EVENT_PROPERTY);

        if (event == null)
        {
            return;
        }
View Full Code Here


    {
        OutboundEndpoint ep = muleContext.getEndpointFactory().getOutboundEndpoint(
            "axis:http://mycompany.com:8080/services/myService?method=foo");
       
        AxisMessageDispatcher dispatcher = new AxisMessageDispatcher(ep);
        MuleEvent event = getTestEvent("test,");
        String result = dispatcher.parseSoapAction("#[hostInfo]/#[method]", new QName("foo"), event);

        assertEquals("http://mycompany.com:8080/foo", result);
    }
View Full Code Here

    public void testHostReplace() throws Exception
    {
        OutboundEndpoint ep = muleContext.getEndpointFactory().getOutboundEndpoint(
            "axis:http://mycompany.com:8080/services/myService?method=foo");
        AxisMessageDispatcher dispatcher = new AxisMessageDispatcher(ep);
        MuleEvent event = getTestEvent("test,");
        String name = event.getFlowConstruct().getName();
        String result = dispatcher.parseSoapAction("#[scheme]://#[host]:#[port]/#[serviceName]/#[method]",
            new QName("foo"), event);

        assertEquals("http://mycompany.com:8080/" + name + "/foo", result);
    }
View Full Code Here

     */
    public void dispatch(String url, Object payload, Map messageProperties) throws MuleException
    {
        MuleMessage message = new DefaultMuleMessage(payload, messageProperties, muleContext);
        OutboundEndpoint endpoint = muleContext.getEndpointFactory().getOutboundEndpoint(url);
        MuleEvent event = getEvent(message,endpoint);
        try
        {
            endpoint.process(event);
        }
        catch (MuleException e)
View Full Code Here

     */
    public MuleMessage send(String url, Object payload, Map messageProperties) throws MuleException
    {
        MuleMessage message = new DefaultMuleMessage(payload, messageProperties, muleContext);
        OutboundEndpoint endpoint = getOutboundEndpoint(url, MessageExchangePattern.REQUEST_RESPONSE);
        MuleEvent event = getEvent(message, endpoint);

        try
        {
            MuleEvent resultEvent = endpoint.process(event);
            if (resultEvent != null)
            {
                return resultEvent.getMessage();
            }
            else
            {
                return null;
            }
View Full Code Here

    {
        OutboundEndpoint ep = muleContext.getEndpointFactory().getOutboundEndpoint(
            "axis:http://www.muleumo.org/services/myService?method=myTestMethod");
        AxisMessageDispatcher dispatcher = new AxisMessageDispatcher(ep);
        dispatcher.service = new Service();
        MuleEvent event = getTestEvent("testPayload");
        // there should be no NullPointerException
        Call call = dispatcher.getCall(event, new Object[]{null});

        assertNotNull(call);

        MuleMessage msg = event.getMessage();
        assertNotNull(msg);
        final Map soapMethods = msg.getOutboundProperty(AxisConnector.SOAP_METHODS);
        assertEquals(1, soapMethods.size());
        final List values = (List)soapMethods.get("myTestMethod");
        assertNotNull(values);
View Full Code Here

    public void testAutoDeleteFalseOnDispatcher() throws Exception
    {
        ((FileConnector)connector).setAutoDelete(false);

        MuleEvent event = getTestEvent("TestData");
        event = RequestContext.setEvent(event);

        MuleMessage message = RequestContext.getEventContext().requestEvent(getTestEndpointURI()+"/"+tempDirName+"?connector=FileConnector", 50000);
        // read the payload into a string so the file is deleted on InputStream.close()
        assertNotNull(message.getPayloadAsString());
View Full Code Here

    public void testAutoDeleteTrueOnDispatcher() throws Exception
    {
        ((FileConnector)connector).setAutoDelete(true);

        MuleEvent event = getTestEvent("TestData");
        event = RequestContext.setEvent(event);

        MuleMessage message = RequestContext.getEventContext().requestEvent(getTestEndpointURI()+"/"+tempDirName, 50000);
        assertNotNull(message.getPayload());
        assertTrue(message.getPayload() instanceof InputStream);
View Full Code Here

        MuleClient client = new MuleClient(muleContext);
        MuleMessage m = client.send(((InboundEndpoint) client.getMuleContext().getRegistry().lookupObject("inTestUMO")).getAddress() + "?method=echo",new DefaultMuleMessage("hello", muleContext));
        assertNotNull(m);
       
        // check that our https connector is being used
        MuleEvent event = RequestContext.getEvent();
        assertTrue (event.getEndpoint().getConnector() instanceof HttpsConnector);
        assertTrue(event.getEndpoint().getConnector().getName().equals("myHttpsConnector"));
    }
View Full Code Here

    {
        try
        {
            // Rewrite the message to treat it as a new message
            MuleMessage newMessage = message.createInboundMessage();
            MuleEvent event =  routeMessage(newMessage);
            MuleMessage returnedMessage = event == null ? null : event.getMessage();
            if (returnedMessage != null)
            {
                returnedMessage = returnedMessage.createInboundMessage();
            }
            return returnedMessage;
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.