Package org.mule.api.endpoint

Examples of org.mule.api.endpoint.OutboundEndpoint


    }

    protected synchronized OutboundEndpoint getEndpoint(MuleEvent event, String endpointUri) throws MuleException
    {
        OutboundEndpoint endpoint = (OutboundEndpoint) endpointCache.get(endpointUri);
        if (endpoint == null)
        {
            EndpointFactory endpointFactory = muleContext.getEndpointFactory();
            EndpointBuilder endpointBuilder = endpointFactory.getEndpointBuilder(endpointUri);
            if (transformers == null)
View Full Code Here


            // (if any) of the the targets may not have a filter
            //Try each endpoint in the list. If there is no match for any of them we drop out and throw an exception
            for (int j = 0; j < endpoints.size(); j++)
            {
                MessageProcessor target =  endpoints.get(counter.next());
                OutboundEndpoint endpoint = target instanceof OutboundEndpoint ? (OutboundEndpoint) target : null;
                if (endpoint == null || endpoint.getFilter() == null || endpoint.getFilter().accept(part))
                {
                    if (logger.isDebugEnabled())
                    {
                        logger.debug("Endpoint filter matched. Routing message over: "
                                + endpoint.getEndpointURI().toString());
                    }
                    iterator.remove();
                    splitMessage.addPart(part, endpoint);
                    matchFound = true;
                    break;
View Full Code Here

    public void testCxfWsdlServiceWithEndpointParam() throws Exception
    {
        EndpointBuilder endpointBuilder = new EndpointURIEndpointBuilder(TEST_URL_NOWSDL, muleContext);
        endpointBuilder.setProperty("wsdlUrl", TEST_URL_WSDL);

        OutboundEndpoint endpoint =
            muleContext.getEndpointFactory().getOutboundEndpoint(endpointBuilder);

        MuleMessage message = new DefaultMuleMessage("test1", muleContext);
        MuleSession session = new DefaultMuleSession(message,
            ((AbstractConnector) endpoint.getConnector()).getSessionHandler(), muleContext);
        MuleEvent event = new DefaultMuleEvent(message, endpoint.getExchangePattern(), session);
        MuleMessage reply = endpoint.process(event).getMessage();

        assertNotNull(reply);

        Document response = (Document) reply.getPayload();
        assertNotNull(response);
View Full Code Here

        MuleEvent event = (MuleEvent) message.getExchange().get(CxfConstants.MULE_EVENT);
        // are we sending an out of band response for a server side request?
        boolean decoupled = event != null && message.getExchange().getInMessage() != null;
       
        OutboundEndpoint ep = null;
       
        if (event == null || decoupled)
        {
            // we've got an out of band WS-RM message or a message from a standalone client
            MuleContext muleContext = configuration.getMuleContext();
            MuleMessage muleMsg = new DefaultMuleMessage(handler, muleContext);
            MuleSession session = new DefaultMuleSession(muleContext);
           
            String url = setupURL(message);
           
            try
            {
                ep = getEndpoint(muleContext, url);
                event = new DefaultMuleEvent(muleMsg, ep.getExchangePattern(), session);
            }
            catch (Exception e)
            {
                throw new Fault(e);
            }
            event.setTimeout(MuleEvent.TIMEOUT_NOT_SET_VALUE);
        }
        else
        {
            event.getMessage().setPayload(handler);
        }

        if (!decoupled)
        {
            message.getExchange().put(CxfConstants.MULE_EVENT, event);
        }
        message.put(CxfConstants.MULE_EVENT, event);
       
        final MuleEvent finalEvent = event;
        final OutboundEndpoint finalEndpoint = ep;
        AbstractPhaseInterceptor<Message> i = new AbstractPhaseInterceptor<Message>(Phase.PRE_STREAM)
        {
            public void handleMessage(Message m) throws Fault
            {
                try
View Full Code Here

        if (endpoints.get(uri) != null)
        {
            return endpoints.get(uri);
        }

        OutboundEndpoint endpoint = muleContext.getEndpointFactory().getOutboundEndpoint(uri);
        endpoints.put(uri, endpoint);
        return endpoint;
    }
View Full Code Here

        connector.setDispatcherFactory(new DelayTestMessageDispatcherFactory());
    }

    private void dispatchTwoAsyncEvents() throws DispatchException, Exception
    {
        OutboundEndpoint endpoint = muleContext.getEndpointFactory().getOutboundEndpoint(
            "test://test");
        endpoint.process(getTestEvent("data", getTestInboundEndpoint(MessageExchangePattern.ONE_WAY)));
        endpoint.process(getTestEvent("data", getTestInboundEndpoint(MessageExchangePattern.ONE_WAY)));
    }
View Full Code Here

    @Override
    protected Bridge buildFlowConstruct(MuleContext muleContext) throws MuleException
    {
        InboundEndpoint inboundEndpoint = getOrBuildInboundEndpoint(muleContext);
        OutboundEndpoint outboundEndpoint = getOrBuildOutboundEndpoint(muleContext);

        if (transacted)
        {
            setTransactionFactoriesIfNeeded(inboundEndpoint, outboundEndpoint);
        }
View Full Code Here

            muleContext);
        Properties props = new Properties();
        props.put(RmiConnector.PROPERTY_SERVICE_METHOD_PARAM_TYPES, StringBuffer.class.getName());
        builder.setProperties(props);

        OutboundEndpoint ep = muleContext.getEndpointFactory().getOutboundEndpoint(
            builder);
        try
        {
            ep.process(getTestEvent("hello"));
        }
        catch (Exception e)
        {
            assertTrue(e instanceof DispatchException);
            assertTrue(e.getCause() instanceof NoSuchMethodException);
View Full Code Here

            muleContext);
        Properties props = new Properties();
        props.put(RmiConnector.PROPERTY_SERVICE_METHOD_PARAM_TYPES, String.class.getName());
        builder.setProperties(props);
       
        OutboundEndpoint ep = muleContext.getEndpointFactory().getOutboundEndpoint(
            builder);
       
        try
        {
            ep.process(getTestEvent("hello"));
        }
        catch (Exception e)
        {
            assertTrue(e instanceof DispatchException);
            assertTrue(e.getCause() instanceof NoSuchMethodException);
View Full Code Here

    {
        for (MessageProcessor route : routes)
        {
            if (route instanceof OutboundEndpoint)
            {
                OutboundEndpoint endpoint = (OutboundEndpoint) route;
                if (endpoint.getName().equals(name))
                {
                    return endpoint;
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.mule.api.endpoint.OutboundEndpoint

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.