Package org.apache.qpid.client

Examples of org.apache.qpid.client.AMQConnectionFactory


    /**
     * Create a BDBStoreUpgradeTestPreparer instance
     */
    public BDBStoreUpgradeTestPreparer () throws URLSyntaxException
    {
        _connFac = new AMQConnectionFactory(CONN_URL);
    }
View Full Code Here


     */
    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

                            "'tcp://%s:%s?retries='%s'&connectdelay='%s''&failover='singlebroker?cyclecount='%s''";

        String newUrl = String.format(newUrlFormat, origBrokerDetails.getHost(), origBrokerDetails.getPort(),
                                                    retries, connectdelay, cycleCount);

        ConnectionFactory connectionFactory = new AMQConnectionFactory(newUrl);
        AMQConnection connection = (AMQConnection) connectionFactory.createConnection("admin", "admin");
        connection.setConnectionListener(this);
        return connection;
    }
View Full Code Here

    @Override
    public Reference getReference() throws NamingException
    {
        try
        {
            _delegate = new AMQConnectionFactory(getConnectionURL());
            /*
            QpidResourceAdapter ra = new QpidResourceAdapter();
            QpidRAManagedConnectionFactory mcf = new QpidRAManagedConnectionFactory();
            mcf.setResourceAdapter(ra);
            mcf.setConnectionURL(getConnectionURL());
View Full Code Here

    }

    public Connection getConnection(ConnectionURL url) throws JMSException
    {
        _logger.info(url.getURL());
        Connection connection = new AMQConnectionFactory(url).createConnection(url.getUsername(), url.getPassword());

        _connections.add(connection);

        return connection;
    }
View Full Code Here

    }

    public Connection getConnection(ConnectionURL url) throws JMSException
    {
        _logger.info(url.getURL());
        Connection connection = new AMQConnectionFactory(url).createConnection(url.getUsername(), url.getPassword());

        _connections.add(connection);

        return connection;
    }
View Full Code Here

    }

    private AMQConnection createConnectionWithFailover() throws NamingException, JMSException
    {
        AMQConnection connection;
        AMQConnectionFactory connectionFactory = (AMQConnectionFactory)getConnectionFactory("default");
        ConnectionURL connectionURL = connectionFactory.getConnectionURL();
        connectionURL.setOption(ConnectionURL.OPTIONS_FAILOVER, "singlebroker");
        connectionURL.setOption(ConnectionURL.OPTIONS_FAILOVER_CYCLE, "2");
        BrokerDetails details = connectionURL.getBrokerDetails(0);
        details.setProperty(BrokerDetails.OPTIONS_RETRY, "200");
        details.setProperty(BrokerDetails.OPTIONS_CONNECT_DELAY, "1000");

        connection = (AMQConnection)connectionFactory.createConnection("admin", "admin");
        connection.setConnectionListener(this);
        return connection;
    }
View Full Code Here

    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

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


    public Connection getConnection(ConnectionURL url) throws JMSException
    {
        _logger.debug("get connection for " + url.getURL());
        Connection connection = new AMQConnectionFactory(url).createConnection(url.getUsername(), url.getPassword());

        _connections.add(connection);

        return connection;
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.client.AMQConnectionFactory

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.