Examples of AMQConnectionFactory


Examples of org.apache.qpid.client.AMQConnectionFactory

class AMQConnectionFactoryInitialiser implements ConnectionFactoryInitialiser
{
    public ConnectionFactory getFactory(ConnectorConfig config)
    {
        return new AMQConnectionFactory(config.getHost(), config.getPort(), "/test_path");
    }
View Full Code Here

Examples of org.apache.qpid.client.AMQConnectionFactory

    public AMQPComponent(AMQConnectionFactory connectionFactory) {
        setConnectionFactory(connectionFactory);
    }

    public static Component amqpComponent(String uri) throws URLSyntaxException {
        AMQConnectionFactory connectionFactory = new AMQConnectionFactory(uri);
        return new AMQPComponent(connectionFactory);
    }
View Full Code Here

Examples of org.apache.qpid.client.AMQConnectionFactory

    /**
     * Lets install the default connection factory
     */
    private void init() {
        AMQConnectionFactory connectionFactory = new AMQConnectionFactory();
        setConnectionFactory(connectionFactory);
    }
View Full Code Here

Examples of org.apache.qpid.client.AMQConnectionFactory

            // Create the Connection to be bound


            try
            {
                connectionFactory = new AMQConnectionFactory(_connectionString);
                connection = connectionFactory.createConnection();

                _connectionFactoryString = ((AMQConnectionFactory) connectionFactory).getConnectionURL().getURL();
            }
            catch (JMSException jmsqe)
View Full Code Here

Examples of org.apache.qpid.client.AMQConnectionFactory

            // Create the object to be bound
            ConnectionFactory factory = null;

            try
            {
                factory = new AMQConnectionFactory(CONNECTION_URL);


                try
                {
                    Object obj = ctx.lookup(binding);
View Full Code Here

Examples of org.apache.qpid.client.AMQConnectionFactory

            Assert.fail("Error loading context:" + ne);
        }

        try
        {
            AMQConnectionFactory cf = (AMQConnectionFactory) ctx.lookup("local");
            Assert.assertEquals("amqp://guest:guest@clientid/testpath?brokerlist='vm://:1'", cf.getConnectionURL().toString());
        }
        catch (NamingException ne)
        {
            Assert.fail("Unable to create Connection Factory:" + ne);
        }
View Full Code Here

Examples of org.apache.qpid.client.AMQConnectionFactory

        {
            print(key + ":" + object);
        }
        else if (object instanceof AMQConnectionFactory)
        {
            AMQConnectionFactory factory = (AMQConnectionFactory) object;
            print(key + ":Connection");
            print("ConnectionURL:");
            print(factory.getConnectionURL().toString());
            print("FailoverPolicy");
            print(new FailoverPolicy(factory.getConnectionURL(),null).toString());
            print("");
        }
    }
View Full Code Here

Examples of org.apache.qpid.client.AMQConnectionFactory

    public static final String URL = "amqp://guest:guest@clientID/test?brokerlist='tcp://localhost:5672'";
    public static final String URL_STAR_PWD = "amqp://guest:********@clientID/test?brokerlist='tcp://localhost:5672'";

    public void testConnectionURLStringMasksPassword() throws Exception
    {
        AMQConnectionFactory factory = new AMQConnectionFactory(URL);

        //URL will be returned with the password field swapped for '********'
        assertEquals("Connection URL not correctly set", URL_STAR_PWD, factory.getConnectionURLString());

        // Further test that the processed ConnectionURL is as expected after
        // the set call
        ConnectionURL connectionurl = factory.getConnectionURL();

        assertNull("Failover is set.", connectionurl.getFailoverMethod());
        assertEquals("guest", connectionurl.getUsername());
        assertEquals("guest", connectionurl.getPassword());
        assertEquals("clientID", connectionurl.getClientName());
View Full Code Here

Examples of org.apache.qpid.client.AMQConnectionFactory

        assertEquals(5672, service.getPort());
    }

    public void testInstanceCreatedWithDefaultConstructorThrowsExceptionOnCallingConnectWithoutSettingURL() throws Exception
    {
        AMQConnectionFactory factory = new AMQConnectionFactory();

        try
        {
            factory.createConnection();
            fail("Expected exception not thrown");
        }
        catch(JMSException e)
        {
            assertEquals("Unexpected exception", AMQConnectionFactory.NO_URL_CONFIGURED, e.getMessage());
View Full Code Here

Examples of org.apache.qpid.client.AMQConnectionFactory

     */
    protected ConnectionFactory createFactory(String url) throws ConfigurationException
    {
        try
        {
            return new AMQConnectionFactory(url);
        }
        catch (URLSyntaxException urlse)
        {
            _logger.warn("Unable to create factory:" + urlse);

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.