Package org.mule.api.transport

Examples of org.mule.api.transport.MessageReceiver


        {
            logger.trace("Looking up receiver on connector: " + connector.getName() + " with URI key: "
                         + requestUri.toString());
        }

        MessageReceiver receiver = connector.lookupReceiver(uriStr);

        // If no receiver on the root and there is a request path, look up the
        // received based on the root plus request path
        if (receiver == null && !"/".equals(path))
        {
View Full Code Here


    }

    public static MessageReceiver findReceiverByStem(Map<Object, MessageReceiver> receivers, String uriStr)
    {
        int match = 0;
        MessageReceiver receiver = null;
        for (Map.Entry<Object, MessageReceiver> e : receivers.entrySet())
        {
            String key = (String) e.getKey();
            MessageReceiver candidate = e.getValue();
            if (uriStr.startsWith(key) && match < key.length())
            {
                match = key.length();
                receiver = candidate;
            }
View Full Code Here

    }

     @Override
    protected MessageReceiver createReceiver(FlowConstruct flowConstruct, InboundEndpoint endpoint) throws Exception
    {
        MessageReceiver receiver = super.createReceiver(flowConstruct, endpoint);
        registerJettyEndpoint(receiver, endpoint);
        return receiver;
    }
View Full Code Here

            {
                logger.debug(message.getInboundProperty(HttpConnector.HTTP_REQUEST_PROPERTY));
            }

            // determine if the request path on this request denotes a different receiver
            final MessageReceiver receiver = getTargetReceiver(message, endpoint);

            HttpResponse response;
            // the response only needs to be transformed explicitly if
            // A) the request was not served or B) a null result was returned
            if (receiver != null)
            {
                String contextPath = HttpConnector.normalizeUrl(receiver.getEndpointURI().getPath());
                message.setProperty(HttpConnector.HTTP_CONTEXT_PATH_PROPERTY,
                                    contextPath,
                                    PropertyScope.INBOUND);

                message.setProperty(HttpConnector.HTTP_CONTEXT_URI_PROPERTY,
                                    receiver.getEndpointURI().getAddress(),
                                    PropertyScope.INBOUND);

                message.setProperty(HttpConnector.HTTP_RELATIVE_PATH_PROPERTY,
                                    processRelativePath(contextPath, path),
                                    PropertyScope.INBOUND);

                ExecutionTemplate<MuleEvent> executionTemplate = createExecutionTemplate();

                MuleEvent returnEvent;
                try
                {
                    returnEvent = executionTemplate.execute(new ExecutionCallback<MuleEvent>()
                    {
                        @Override
                        public MuleEvent process() throws Exception
                        {
                            preRouteMessage(message);
                            return receiver.routeMessage(message);
                        }
                    });
                }
                catch (MuleException e)
                {
View Full Code Here

    }

    @Override
    protected MessageReceiver createReceiver(FlowConstruct flowConstruct, InboundEndpoint endpoint) throws Exception
    {
        MessageReceiver receiver = getServiceDescriptor().createMessageReceiver(this, flowConstruct, endpoint);
        //If the connector has not started yet, the Bayeux object will still be null
        ((AjaxMessageReceiver) receiver).setBayeux(getBayeux());
        return receiver;
    }
View Full Code Here

TOP

Related Classes of org.mule.api.transport.MessageReceiver

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.