Package org.mule.api.transport

Examples of org.mule.api.transport.Connector


    }

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


    protected Connector findConnector()
    {
        String connectorName = (String) serializedData.get("connectorName");
        String connectorType = (String) serializedData.get("connectorType");
        Connector found =  null;

        if (connectorName != null)
        {
            found = muleContext.getRegistry().get(connectorName);
        }
View Full Code Here

    // MULE-2130 (Impossible to re-initialise SMTP connector)
    @Test
    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

    }

    @Test
    public void testUndeploy() throws Exception
    {
        final Connector connector = new TestConnector(muleContext);
        connector.setName("TEST_CONNECTOR");
        muleContext.getRegistry().registerConnector(connector);
        muleContext.start();

        domainName = jmxSupport.getDomainName(muleContext);
        final String query = domainName + ":*";
 
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

    protected String encoding;

    @Override
    protected void doSetUp() throws Exception
    {
        Connector connector = createConnector();
        if (connector.getName() == null)
        {
            connector.setName("test");
        }
        connectorName = connector.getName();
        muleContext.getRegistry().registerConnector(connector);
        encoding = muleContext.getConfiguration().getDefaultEncoding();
    }
View Full Code Here

    }

    @Override
    protected void doTearDown() throws Exception
    {
        Connector connector = getConnector();
        if (connector != null && connector.isDisposed())
        {
            fail("Connector has been disposed prematurely - lifecycle problem? Instance: " + connector);
        }
    }
View Full Code Here

        return (muleContext == null) null : muleContext.getRegistry().lookupConnector(connectorName);
    }

    protected Connector getConnectorAndAssert()
    {
        Connector connector = getConnector();
        assertNotNull(connector);
        return connector;
    }
View Full Code Here

    }

    @Test
    public void testConnectorExceptionHandling() throws Exception
    {
        Connector connector = getConnectorAndAssert();

        // Text exception handler
        SystemExceptionHandler ehandlerMock = mock(SystemExceptionHandler.class);

        assertNotNull(muleContext.getExceptionListener());
View Full Code Here

    public void testConnectorLifecycle() throws Exception
    {
        // this test used to use the connector created for this test, but since we need to
        // simulate disposal as well we have to create an extra instance here.

        Connector localConnector = createConnector();
        localConnector.setName(connectorName+"-temp");
        // the connector did not come from the registry, so we need to initialise manually
        localConnector.initialise();
        localConnector.start();

        assertNotNull(localConnector);
        assertTrue(localConnector.isStarted());
        assertTrue(!localConnector.isDisposed());
        localConnector.stop();
        assertTrue(!localConnector.isStarted());
        assertTrue(!localConnector.isDisposed());
        localConnector.dispose();
        assertTrue(!localConnector.isStarted());
        assertTrue(localConnector.isDisposed());

        try
        {
            localConnector.start();
            fail("Connector cannot be restarted after being disposing");
        }
        catch (Exception e)
        {
            // expected
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.