Package org.mule.service

Examples of org.mule.service.ServiceCompositeMessageSource


    public void testEndpointURIParamsConfig()
    {
        Service d = muleContext.getRegistry().lookupService("testPropertiesComponent");
        assertNotNull(d);
        final ServiceCompositeMessageSource router = (ServiceCompositeMessageSource) d.getMessageSource();
        assertNotNull(router);
        final List endpoints = router.getEndpoints();
        assertNotNull(endpoints);
        assertFalse(endpoints.isEmpty());
        final ImmutableEndpoint inboundEndpoint = (ImmutableEndpoint) endpoints.get(0);
        assertNotNull(inboundEndpoint);
        final List transformers = inboundEndpoint.getTransformers();
View Full Code Here


                muleContext.getEndpointFactory().getInboundEndpoint("vm://*"));
        }
        else
        {
            // Set multiple inbound subscriptions on the descriptor
            ServiceCompositeMessageSource messageRouter = (ServiceCompositeMessageSource) service.getMessageSource();

            for (int i = 0; i < subscriptions.length; i++)
            {
                String subscription = subscriptions[i];

                EndpointFactory endpointFactory = muleContext.getEndpointFactory();
                EndpointBuilder endpointBuilder = endpointFactory.getEndpointBuilder(subscription);
                endpointBuilder.setExchangePattern(MessageExchangePattern.fromSyncFlag(!asynchronous));
                InboundEndpoint endpoint = endpointFactory.getInboundEndpoint(endpointBuilder);

                messageRouter.addSource(endpoint);
            }
        }
        DefaultJavaComponent component = new DefaultJavaComponent(new SingletonObjectFactory(this));
        component.setMuleContext(muleContext);
        service.setComponent(component);
View Full Code Here

    }

    public void testThatTheCorrectSoapPortIsChosen() throws Exception
    {
        final Service service = muleContext.getRegistry().lookupService("CXFProxyService");
        ServiceCompositeMessageSource messageSource = (ServiceCompositeMessageSource) service.getMessageSource();

        List<InboundEndpoint> endpoints = messageSource.getEndpoints();
        DefaultInboundEndpoint inboundEndpoint = (DefaultInboundEndpoint) endpoints.get(0);
        List<MessageProcessor> processors = inboundEndpoint.getMessageProcessors();
        FlowConfiguringMessageProcessor wrapper = (FlowConfiguringMessageProcessor) processors.get(0);
        CxfInboundMessageProcessor cxfProcessor = (CxfInboundMessageProcessor) wrapper.getWrappedMessageProcessor();
        Server server = cxfProcessor.getServer();
View Full Code Here

        mockEndpoint.expectAndReturn("getProperties", properties);
        InboundEndpoint inboundEndpoint = (InboundEndpoint) mockEndpoint.proxy();

        Mock mockService = new Mock(Service.class);
        mockService.expectAndReturn("getResponseRouter", null);
        mockService.expectAndReturn("getInboundRouter", new ServiceCompositeMessageSource());
        Service service = (Service) mockService.proxy();

        MockHttpsMessageReceiver messageReceiver = new MockHttpsMessageReceiver(httpsConnector, service, inboundEndpoint);
        return messageReceiver;
    }
View Full Code Here

        assertEquals(0, resourceAdapter.endpoints.size());
    }

    protected void testEndpoint(Service service)
    {
        ServiceCompositeMessageSource inboundRouterCollection = (ServiceCompositeMessageSource) service.getMessageSource();
        ImmutableEndpoint endpoint = inboundRouterCollection.getEndpoints().get(0);
        assertEndpointAttributes(endpoint);
    }
View Full Code Here

        SslConnector connector = new SslConnector(muleContext);
        connector.setSslHandshakeTimeout(1000);
       
        Mock mockService = new Mock(Service.class);
        mockService.expect("getResponseRouter");
        mockService.expectAndReturn("getInboundRouter", new ServiceCompositeMessageSource());
        Service service = (Service) mockService.proxy();
       
        Map<String, Object> properties = Collections.emptyMap();

        Mock mockEndpoint = new Mock(InboundEndpoint.class);
View Full Code Here

{
    public MessageReceiver getMessageReceiver() throws Exception
    {
        Mock mockComponent = new Mock(Service.class);
        mockComponent.expect("getResponseRouter");
        mockComponent.expectAndReturn("getInboundRouter", new ServiceCompositeMessageSource());
        return new SslMessageReceiver(endpoint.getConnector(), (Service) mockComponent.proxy(), endpoint);
    }
View Full Code Here

    {
        endpoint = muleContext.getEndpointFactory().getInboundEndpoint(
            "udp://localhost:10100");
        Mock mockComponent = new Mock(Service.class);
        mockComponent.expect("getResponseRouter");
        mockComponent.expectAndReturn("getInboundRouter", new ServiceCompositeMessageSource());

        return new UdpMessageReceiver(endpoint.getConnector(), (Service) mockComponent.proxy(), endpoint);
    }
View Full Code Here

{
    public MessageReceiver getMessageReceiver() throws Exception
    {
        Mock mockComponent = new Mock(Service.class);
        mockComponent.expect("getResponseRouter");
        mockComponent.expectAndReturn("getInboundRouter", new ServiceCompositeMessageSource());

        return new HttpMessageReceiver(endpoint.getConnector(), (Service) mockComponent.proxy(), endpoint);
    }
View Full Code Here

{
    public MessageReceiver getMessageReceiver() throws Exception
    {
        Mock mockComponent = new Mock(Service.class);
        mockComponent.expect("getResponseRouter");
        mockComponent.expectAndReturn("getInboundRouter", new ServiceCompositeMessageSource());

        return new MulticastMessageReceiver((AbstractConnector)endpoint.getConnector(),
            (Service)mockComponent.proxy(), endpoint);
    }
View Full Code Here

TOP

Related Classes of org.mule.service.ServiceCompositeMessageSource

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.