Package org.mule.api.transport

Examples of org.mule.api.transport.Connector


    }

    public void setAsText(String text)
    {

        Connector connector = muleContext.getRegistry().lookupConnector(text);

        if (connector == null)
        {
            throw new IllegalArgumentException(CoreMessages.objectNotRegistered("Connector", text).getMessage());
        }
View Full Code Here


            // Next see if there are any Connectors to register
            Map connectors = applicationContext.getBeansOfType(Connector.class, true, true);
            if (connectors.size() > 0)
            {
                Map.Entry entry;
                Connector c;
                for (Iterator iterator = connectors.entrySet().iterator(); iterator.hasNext();)
                {
                    entry = (Map.Entry) iterator.next();
                    c = (Connector) entry.getValue();
                    if (c.getName() == null)
                    {
                        c.setName(entry.getKey().toString());
                    }
                    muleContext.getRegistry().registerConnector(c);
                }
            }
        }
View Full Code Here

    }

    @Override
    public Connector createConnector(EndpointURI endpointURI) throws TransportFactoryException
    {
        Connector c;
        String scheme = endpointURI.getScheme();
        Map temp = new Properties();
        PropertiesUtils.getPropertiesWithPrefix(overrides, scheme, temp);
        temp = PropertiesUtils.removeNamespaces(temp);
        String singleton = (String) temp.remove(SINGLETON_PROPERTY);
View Full Code Here

    {
        Collection<?> connectors = muleContext.getRegistry().lookupObjects(Connector.class);
        AxisConnector connector = null;
        for (Iterator<?> iterator = connectors.iterator(); iterator.hasNext();)
        {
            Connector candidate = (Connector) iterator.next();
            if (candidate instanceof AxisConnector)
            {
                connector = (AxisConnector) candidate;
            }
        }
View Full Code Here

        return "http-service-overrides.xml";
    }

    public void testSessionHandler()
    {
        Connector connector = muleContext.getRegistry().lookupConnector("httpConnector");
        assertTrue(connector instanceof HttpConnector);
       
        HttpConnector httpConnector = (HttpConnector) connector;
        SessionHandler sessionHandler = httpConnector.getSessionHandler();
        assertTrue(sessionHandler instanceof TestSessionHandler);
View Full Code Here

    }

    private void assertEndpointOk(ImmutableEndpoint endpoint)
    {
        assertNotNull("Endpoint is null", endpoint);
        Connector connector = endpoint.getConnector();
        assertTrue("Connector not AXIS", connector instanceof AxisConnector);
    }
View Full Code Here

        assertNull(ftc.getEventCallback());
    }

    public void testConnectorUsingDefaultDispatcherPoolFactory()
    {
        Connector connector = muleContext.getRegistry().lookupConnector("testConnectorWithDefaultFactory");

        assertTrue(connector instanceof TestConnector);
        TestConnector testConnector = (TestConnector) connector;
        assertEquals(DefaultConfigurableKeyedObjectPoolFactory.class, testConnector.getDispatcherPoolFactory().getClass());
        assertEquals(DefaultConfigurableKeyedObjectPool.class, testConnector.getDispatchers().getClass());
View Full Code Here

        assertEquals(DefaultConfigurableKeyedObjectPool.class, testConnector.getDispatchers().getClass());
    }

    public void testConnectorUsingOverriddenDispatcherPoolFactory()
    {
        Connector connector = muleContext.getRegistry().lookupConnector("testConnectorWithOverriddenFactory");

        assertTrue(connector instanceof TestConnector);
        TestConnector testConnector = (TestConnector) connector;
        assertEquals(StubDispatcherPoolFactory.class, testConnector.getDispatcherPoolFactory().getClass());
        assertEquals(StubConfigurableKeyedObjectPool.class, testConnector.getDispatchers().getClass());
View Full Code Here

        // Try to figure out our endpoint's JMS Specification and fall back to
        // 1.0.2 if none is set.
        String jmsSpec = JmsConstants.JMS_SPECIFICATION_102B;
        if (endpoint != null)
        {
            Connector connector = endpoint.getConnector();
            if (connector instanceof JmsConnector)
            {
                jmsSpec = ((JmsConnector) connector).getSpecification();
            }
        }
View Full Code Here

        FileUtils.deleteTree(FileUtils.newFile(getTestConnector().getProtocol()));
        super.doTearDown();
    }

    public Connector getConnector() throws Exception {
        Connector connector = new FileConnector(muleContext);
        connector.setName("FileConnector");
        muleContext.getRegistry().registerConnector(connector);
        return connector;
    }
View Full Code Here

TOP

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

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.