Examples of OutboundEndpoint


Examples of org.mule.api.endpoint.OutboundEndpoint

        this.factory = factory;
    }

    public void activateObject(Object key, Object obj) throws Exception
    {
        OutboundEndpoint endpoint = (OutboundEndpoint)key;
        //Ensure dispatcher has the same lifecycle as the connector
        applyLifecycle((MessageDispatcher)obj);

        factory.activate((OutboundEndpoint) key, (MessageDispatcher) obj);
    }
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

        factory.destroy((OutboundEndpoint) key, (MessageDispatcher) obj);
    }

    public Object makeObject(Object key) throws Exception
    {
        OutboundEndpoint endpoint = (OutboundEndpoint) key;
        MessageDispatcher dispatcher = factory.create(endpoint);
        applyLifecycle(dispatcher);
        return dispatcher;
    }
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

            builder = new EndpointURIEndpointBuilder(new URIBuilder(endpointUri));
        }

        builder.setExchangePattern(MessageExchangePattern.REQUEST_RESPONSE);

        OutboundEndpoint endpoint = getMuleContext().getEndpointFactory().getOutboundEndpoint(builder);
        return clientInterface.process(endpoint, message);
    }
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

            builder = new EndpointURIEndpointBuilder(new URIBuilder(endpointUri));
        }

        builder.setExchangePattern(MessageExchangePattern.ONE_WAY);

        OutboundEndpoint endpoint = getMuleContext().getEndpointFactory().getOutboundEndpoint(builder);
        clientInterface.process(endpoint, message);    }
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

            builder = new EndpointURIEndpointBuilder(new URIBuilder(endpointName, muleContext));
        }

        builder.setExchangePattern(MessageExchangePattern.ONE_WAY);

        OutboundEndpoint endpoint = getMuleContext().getEndpointFactory().getOutboundEndpoint(builder);
        clientInterface.process(endpoint, message);
    }
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

        assertTrue(connector.isCreateAccount());
    }

    public void testSendingMessageEndpoint() throws Exception
    {
        OutboundEndpoint endpoint = lookupOutboundEndpoint("sendingMessageEndpoint");
        assertEquals("xmpp://MESSAGE/recipient@jabberhost", endpoint.getEndpointURI().toString());
        assertEquals("TheSubject", endpoint.getProperty(XmppConnector.XMPP_SUBJECT));
    }
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

        message.addProperties(messageProperties, PropertyScope.INVOCATION);

        //TODO should probably cache this
        EndpointBuilder endpointBuilder = muleContext.getEndpointFactory().getEndpointBuilder(endpoint);
        endpointBuilder.setExchangePattern(exchangePattern);
        OutboundEndpoint ep = endpointBuilder.buildOutboundEndpoint();
      
        DefaultMuleEvent event = new DefaultMuleEvent(message, ep.getExchangePattern(),
            new DefaultMuleSession(flowConstruct, muleContext));

        RequestContext.setEvent(event);
        MuleEvent resultEvent = ep.process(event);
       
        MuleMessage response = null;
        if (resultEvent != null)
        {
            response = resultEvent.getMessage();
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

        }
        message.addProperties(messageProperties, PropertyScope.INBOUND);
        message.addProperties(messageProperties, PropertyScope.INVOCATION);

        // Use an endpoint cache to prevent memory leaks (see MULE-5422)
        OutboundEndpoint ep = endpointCache.getOutboundEndpoint(endpoint, exchangePattern, null);
        DefaultMuleEvent event = new DefaultMuleEvent(message, ep.getExchangePattern(),
            new DefaultMuleSession(flowConstruct, muleContext));
        RequestContext.setEvent(event);

        // Set correlation properties in SESSION scope so that they get propagated to response messages.
        if (messageProperties.get(PROPERTY_PROCESS_TYPE) != null)
        {
            event.getMessage().setSessionProperty(PROPERTY_PROCESS_TYPE, messageProperties.get(PROPERTY_PROCESS_TYPE));
        }
        if (messageProperties.get(PROPERTY_PROCESS_ID) != null)
        {
            event.getMessage().setSessionProperty(PROPERTY_PROCESS_ID, messageProperties.get(PROPERTY_PROCESS_ID));
        }
       
        MuleEvent resultEvent = ep.process(event);
       
        MuleMessage response = null;
        if (resultEvent != null)
        {
            response = resultEvent.getMessage();
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

    public void testContentType()  throws Exception
    {
        InboundEndpoint inbound = muleContext.getRegistry().lookupObject("inbound");
        assertEquals("text/xml", inbound.getMimeType());
        assertEquals("utf-8", inbound.getEncoding());
        OutboundEndpoint outbound = muleContext.getRegistry().lookupObject("outbound");
        assertEquals("application/json", outbound.getMimeType());
        assertEquals("iso-8859-2", outbound.getEncoding());
        EndpointBuilder global = muleContext.getRegistry().lookupEndpointBuilder("global");
        InboundEndpoint created = global.buildInboundEndpoint();
        assertEquals("application/xml", created.getMimeType());
        assertEquals("iso-8859-1", created.getEncoding());
    }
View Full Code Here

Examples of org.mule.api.endpoint.OutboundEndpoint

        event.getMessage().setOutboundProperty(HttpConnector.HTTP_METHOD_PROPERTY, httpMethod);

        EndpointBuilder endpointBuilder = new EndpointURIEndpointBuilder(tempUrl, muleContext);
        endpointBuilder.setExchangePattern(MessageExchangePattern.REQUEST_RESPONSE);
        OutboundEndpoint outboundEndpoint = endpointBuilder.buildOutboundEndpoint();

        MuleEventContext eventContext = new DefaultMuleEventContext(event);
        result = eventContext.sendEvent(
            new DefaultMuleMessage(requestBody, event.getMessage(), muleContext), outboundEndpoint);
        if (isErrorPayload(result))
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.