Package org.mule.api.transport

Examples of org.mule.api.transport.MessageReceiver


        endpoint.getTransactionConfig().setFactory(new XaTransactionFactory());
       
        TransportServiceDescriptor serviceDescriptor = connector.getServiceDescriptor();

        // see if we get the overridden message receiver
        MessageReceiver receiver = serviceDescriptor.createMessageReceiver(connector,
            getTestService(), endpoint);
        assertEquals(TestMessageReceiver.class, receiver.getClass());       
    }
View Full Code Here


        if(StringUtils.EMPTY.equals(key))
        {
            key = httpServletRequest.getContextPath();
        }

        MessageReceiver receiver = (MessageReceiver)receivers.get(key);
        if (receiver == null)
        {
            receiver = HttpMessageReceiver.findReceiverByStem(receivers, key);
        }
       
View Full Code Here

        try
        {
            final Continuation continuation = ContinuationSupport.getContinuation(request, mutex);
            synchronized (mutex)
            {
                MessageReceiver receiver = getReceiverForURI(request);

                MuleMessage requestMessage = receiver.createMuleMessage(request);
                requestMessage.setOutboundProperty(HttpConnector.HTTP_METHOD_PROPERTY, request.getMethod());

                //This will allow Mule to continue the response once the service has do its processing
                requestMessage.setReplyTo(continuation);
                setupRequestMessage(request, requestMessage, receiver);
View Full Code Here

        if (logger.isDebugEnabled())
        {
            logger.debug("Looking up vm receiver for address: " + endpointUri.toString());
        }

        MessageReceiver receiver;
        // If we have an exact match, use it
        receiver = receivers.get(endpointUri.getAddress());
        if (receiver != null)
        {
            if (logger.isDebugEnabled())
            {
                logger.debug("Found exact receiver match on endpointUri: " + endpointUri);
            }
            return receiver;
        }

        // otherwise check each one against a wildcard match
        for (Iterator iterator = receivers.values().iterator(); iterator.hasNext();)
        {
            receiver = (MessageReceiver)iterator.next();
            String filterAddress = receiver.getEndpointURI().getAddress();
            WildcardFilter filter = new WildcardFilter(filterAddress);
            if (filter.accept(endpointUri.getAddress()))
            {
                InboundEndpoint endpoint = receiver.getEndpoint();
                EndpointURI newEndpointURI = new MuleEndpointURI(endpointUri, filterAddress);
                receiver.setEndpoint(new DynamicURIInboundEndpoint(endpoint, newEndpointURI));

                if (logger.isDebugEnabled())
                {
                    logger.debug("Found receiver match on endpointUri: " + receiver.getEndpointURI()
                                 + " against " + endpointUri);
                }
                return receiver;
            }
        }
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

        FileConnector connector = (FileConnector) getConnector();
        connector.setPollingFrequency(POLLING_FREQUENCY);

        InboundEndpoint endpoint = getTestInboundEndpoint("simple");
        Service service = getTestService();
        MessageReceiver receiver = connector.createReceiver(service, endpoint);
        assertEquals("Connector's polling frequency must not be ignored.", POLLING_FREQUENCY,
                ((FileMessageReceiver) receiver).getFrequency());
    }
View Full Code Here

        // Endpoint wants String-typed properties
        endpoint.getProperties().put(FileConnector.PROPERTY_POLLING_FREQUENCY, String.valueOf(POLLING_FREQUENCY_OVERRIDE));

        Service service = getTestService();
        MessageReceiver receiver = connector.createReceiver(service, endpoint);
        assertEquals("Polling frequency endpoint override must not be ignored.", POLLING_FREQUENCY_OVERRIDE,
                ((FileMessageReceiver) receiver).getFrequency());
    }
View Full Code Here

                MuleMessage returnMessage = endpoint.request(to);
                writeResponse(httpServletResponse, returnMessage);
            }
            else
            {
                MessageReceiver receiver = getReceiverForURI(httpServletRequest);
           
                httpServletRequest.setAttribute(PAYLOAD_PARAMETER_NAME, payloadParameterName);
               
                MuleMessage message = receiver.createMuleMessage(httpServletRequest);
                MuleEvent event = receiver.routeMessage(message);
                MuleMessage returnMessage = event == null ? null : event.getMessage();
                writeResponse(httpServletResponse, returnMessage);
            }
        }
        catch (Exception e)
View Full Code Here

    protected void doPost(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
        throws ServletException, IOException
    {
        try
        {
            MessageReceiver receiver = getReceiverForURI(httpServletRequest);

            httpServletRequest.setAttribute(PAYLOAD_PARAMETER_NAME, payloadParameterName);

            MuleMessage message = receiver.createMuleMessage(httpServletRequest,
                receiver.getEndpoint().getEncoding());
           
            MuleEvent event = receiver.routeMessage(message);
            MuleMessage returnMessage = event == null ? null : event.getMessage();
            writeResponse(httpServletResponse, returnMessage);
        }
        catch (Exception e)
        {
View Full Code Here

    protected void doPut(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
        throws ServletException, IOException
    {
        try
        {
            MessageReceiver receiver = getReceiverForURI(httpServletRequest);

            httpServletRequest.setAttribute(PAYLOAD_PARAMETER_NAME, payloadParameterName);

            MuleMessage message = receiver.createMuleMessage(httpServletRequest,
                receiver.getEndpoint().getEncoding());
            receiver.routeMessage(message);

            httpServletResponse.setStatus(HttpServletResponse.SC_CREATED);
            if (feedback)
            {
                httpServletResponse.getWriter().write(
                    "Item was created at endpointUri: " + receiver.getEndpointURI());
            }
        }
        catch (Exception e)
        {
            handleException(e, "Failed to Post event to Mule" + e.getMessage(), httpServletResponse);
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.