Package org.mule.transport

Examples of org.mule.transport.AbstractConnector$DispatcherMessageProcessor


        doListenerTests("stopped", 1, true);
    }

    protected void doListenerTests(String receiverName, int expectedCount, boolean isConnected)
    {
        AbstractConnector connector = (AbstractConnector) muleContext.getRegistry().lookupConnector(
            "connector.test.mule.default");
        assertNotNull(connector);
        assertTrue(connector.isStarted());
        MessageReceiver[] receivers = connector.getReceivers("*" + receiverName + "*");
        assertEquals(expectedCount, receivers.length);
        for (int i = 0; i < expectedCount; i++)
        {
            assertEquals(isConnected, receivers[0].isConnected());
        }
View Full Code Here


        doListenerTests(endpointName, 1, true);
    }

    protected void doListenerTests(String receiverName, int expectedCount, boolean isConnected)
    {
        AbstractConnector connector = (AbstractConnector) muleContext.getRegistry().lookupConnector(
            "connector.test.mule.default");
        assertNotNull(connector);
        assertTrue(connector.isStarted());
        MessageReceiver[] receivers = connector.getReceivers("*" + receiverName + "*");
        assertEquals(expectedCount, receivers.length);
        for (int i = 0; i < expectedCount; i++)
        {
            assertEquals(isConnected, receivers[0].isConnected());
        }
View Full Code Here

        if (connectorName == null)
        {
            throw new JobExecutionException(QuartzMessages.connectorNotInJobDataMap().getMessage());
        }

        AbstractConnector connector = (AbstractConnector) muleContext.getRegistry().lookupConnector(connectorName);
        if (connector == null)
        {
            throw new JobExecutionException(QuartzMessages.noConnectorFound(connectorName).getMessage());
        }

        AbstractMessageReceiver receiver = (AbstractMessageReceiver)connector.lookupReceiver(receiverKey);
        if (receiver == null)
        {
            throw new JobExecutionException(
                QuartzMessages.noReceiverInConnector(receiverKey, connectorName).getMessage());
        }
View Full Code Here

    }

    public void start() throws MuleException
    {
        InboundEndpoint endpoint = (InboundEndpoint) muleContext.getRegistry().lookupObject(this.inboundPollingEndpointName);
        AbstractConnector connector = (AbstractConnector) endpoint.getConnector();
        receiver = (AbstractPollingMessageReceiver) connector.getReceiver(null, endpoint);
        receiver.disableNativeScheduling();
    }
View Full Code Here

{
    @Override
    public MessageReceiver getMessageReceiver() throws Exception
    {
        Service mockService = mock(Service.class);
        AbstractConnector connector = (AbstractConnector)endpoint.getConnector();
        return new MulticastMessageReceiver(connector, mockService, endpoint);
    }
View Full Code Here

{
    @Override
    public MessageReceiver getMessageReceiver() throws Exception
    {
        Service mockService = mock(Service.class);
        AbstractConnector connector = (AbstractConnector)endpoint.getConnector();
        return new TcpMessageReceiver(connector, mockService, endpoint);
    }
View Full Code Here

    }

    @Test
    public void testServiceOverrides()
    {
        AbstractConnector c = (AbstractConnector)muleContext.getRegistry().lookupConnector("test");
        assertNotNull("Connector should not be null", c);
        assertNotNull("Service overrides should not be null", c.getServiceOverrides());
        String temp =  (String)c.getServiceOverrides().get(MuleProperties.CONNECTOR_DISPATCHER_FACTORY);
        assertNotNull("DispatcherFactory override should not be null", temp);
        assertEquals(TestMessageDispatcherFactory.class.getName(), temp);
        Transformer transformer = TransformerUtils.firstOrNull(c.getDefaultInboundTransformers(null));
        assertNotNull("InboundTransformer should not be null", transformer);
        assertEquals(NoActionTransformer.class, transformer.getClass());
    }
View Full Code Here

    // MULE-1878
    @Test
    public void testDuplicate()
    {
        AbstractConnector c1 = (AbstractConnector)muleContext.getRegistry().lookupConnector("test");
        assertNotNull("Connector should not be null", c1);
        Transformer t1 = TransformerUtils.firstOrNull(c1.getDefaultInboundTransformers(null));
        assertNotNull("InboundTransformer should not be null", t1);
        assertEquals(NoActionTransformer.class, t1.getClass());

        AbstractConnector c2 = (AbstractConnector)muleContext.getRegistry().lookupConnector("second");
        assertNotNull("Connector should not be null", c2);
        Transformer t2 = TransformerUtils.firstOrNull(c2.getDefaultInboundTransformers(null));
        assertNull("InboundTransformer should be null", t2);
    }
View Full Code Here

        if (epData.getEncoding() != null)
        {
            endpointBuilder.setEncoding(parsePlaceholderValues(epData.getEncoding()));
        }

        AbstractConnector connector;
        if (epData.getConnectorName() != null)
        {
            connector = (AbstractConnector) muleContext.getRegistry().lookupConnector(parsePlaceholderValues(epData.getConnectorName()));
        }
        else if (epData.getConnector() != null)
        {
            connector = (AbstractConnector) epData.getConnector();
        }
        else
        {
            //We always create a new connecotr for annotations when one has not been configured
            MuleEndpointURI uri = new MuleEndpointURI(parsePlaceholderValues(epData.getAddress()), muleContext);

            connector = (AbstractConnector) transportFactory.createConnector(uri);
            //The ibeans transport factory will not always create a new connector, check before registering
            if (muleContext.getRegistry().lookupConnector(connector.getName()) == null)
            {
                muleContext.getRegistry().registerConnector(connector);
            }
        }
        endpointBuilder.setConnector(connector);

        //Set threading for this connector. Note we simplify by setting all profiles with a single value 'threads'
        //that can be set by the user
        String threadsString = (String) epData.getProperties().get("threads");
        if (threadsString != null)
        {
            int threads = Integer.valueOf(threadsString);
            connector.setMaxDispatchersActive(threads);
            connector.setMaxRequestersActive(threads);
            connector.getReceiverThreadingProfile().setMaxThreadsActive(threads);
            connector.getReceiverThreadingProfile().setMaxThreadsIdle(threads);
        }

        if (epData.getName() != null)
        {
            endpointBuilder.setName(parsePlaceholderValues(epData.getName()));
View Full Code Here

TOP

Related Classes of org.mule.transport.AbstractConnector$DispatcherMessageProcessor

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.