Package org.mule.api.transport

Examples of org.mule.api.transport.Connector


     * MuleMessageFactory. For exhaustive tests of MuleMessageFactory implementations see
     * {@link AbstractMuleMessageFactoryTestCase} and subclasses.
     */
    public void testConnectorMuleMessageFactory() throws Exception
    {
        Connector connector = getConnectorAndAssert();
       
        MuleMessageFactory factory = connector.createMuleMessageFactory();
        assertNotNull(factory);
    }
View Full Code Here


        assertNotNull(factory);
    }

    public void testConnectorMessageDispatcherFactory() throws Exception
    {
        Connector connector = getConnectorAndAssert();

        MessageDispatcherFactory factory = connector.getDispatcherFactory();
        assertNotNull(factory);
    }
View Full Code Here

        assertNotNull(factory);
    }

    public void testConnectorMessageRequesterFactory() throws Exception
    {
        Connector connector = getConnectorAndAssert();

        MessageRequesterFactory factory = connector.getRequesterFactory();
        assertNotNull(factory);
    }
View Full Code Here

        assertNotNull(factory);
    }

    public void testConnectorInitialise() throws Exception
    {
        Connector connector = getConnector();
        try
        {
            connector.initialise();
            fail("A connector cannot be initialised more than once");
        }
        catch (Exception e)
        {
            // expected
View Full Code Here

    }

    public void testValidListener() throws Exception
    {
        Service service = getTestService("orange", Orange.class);
        Connector connector = getConnector();

        InboundEndpoint endpoint2 =
            muleContext.getEndpointFactory().getInboundEndpoint("ssl://localhost:30303");

        connector.registerListener(endpoint2, getSensingNullMessageProcessor(), service);
        try
        {
            connector.registerListener(endpoint2, getSensingNullMessageProcessor(), service);
            fail("cannot register on the same endpointUri");
        }
        catch (Exception e)
        {
            // expected
View Full Code Here

    }

    @Override
    public Connector createConnector() throws Exception
    {
        Connector connector = super.createConnector();
        ((AbstractRetrieveMailConnector) connector).setBackupEnabled(backupEnabled);
        return connector;
    }
View Full Code Here


    // MULE-2130 (Impossible to re-initialise SMTP connector)
    public void testConnectorRestart() throws Exception
    {
        Connector c = getConnector();
        assertTrue(c.isStarted());

        c.stop();
        assertFalse(c.isStarted());

        assertFalse(c.isStarted());

        c.start();
        assertFalse(c.isDisposed());
        assertTrue(c.isStarted());
    }
View Full Code Here

    }

    public void testValidListener() throws Exception
    {
        Service service = getTestService("orange", Orange.class);
        Connector connector = getConnector();

        InboundEndpoint endpoint2 = muleContext.getRegistry()
            .lookupEndpointFactory()
            .getInboundEndpoint("multicast://228.2.3.4:10100");

        connector.registerListener(endpoint2, getSensingNullMessageProcessor(), service);
        try
        {
            connector.registerListener(endpoint2, getSensingNullMessageProcessor(), service);
            fail("cannot register on the same endpointUri");
        }
        catch (Exception e)
        {
            // expected
View Full Code Here

        if (null == endpoint)
        {
            throw new TransformerException(this,
                    new IllegalStateException("The transformer is no associated with an endpoint."));
        }
        Connector connector = endpoint.getConnector();
        if (!(connector instanceof AbstractMailConnector))
        {
            throw new TransformerException(this,
                    new IllegalStateException("The transformer is not associated with an email endpoint."));
        }
View Full Code Here

    public Connector createConnector(EndpointURI url) throws TransportFactoryException
    {

        try
        {
            Connector connector;
            String scheme = url.getFullScheme();

            TransportServiceDescriptor sd = (TransportServiceDescriptor)
                    muleContext.getRegistry().lookupServiceDescriptor(ServiceType.TRANSPORT, scheme, null);
            if (sd == null)
            {
                throw new ServiceException(CoreMessages.noServiceTransportDescriptor(scheme));
            }

            connector = sd.createConnector();
            if (connector != null)
            {
                if (connector instanceof AbstractConnector)
                {
                    ((AbstractConnector) connector).initialiseFromUrl(url);
                }
            }
            else
            {
                throw new TransportFactoryException(
                        CoreMessages.objectNotSetInService("Connector", scheme));
            }

            connector.setName(new ObjectNameHelper(muleContext).getConnectorName(connector));

            return connector;
        }
        catch (Exception e)
        {
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.