Package org.apache.activemq

Examples of org.apache.activemq.ActiveMQXAConnectionFactory.createConnection()


    public void testCreateVMConnectionWithEmbdeddBroker() throws URISyntaxException, JMSException {
        ActiveMQXAConnectionFactory cf = new ActiveMQXAConnectionFactory("vm://localhost?broker.persistent=false");
        // Make sure the broker is not created until the connection is instantiated.
        assertNull( BrokerRegistry.getInstance().lookup("localhost") );       
        Connection connection = cf.createConnection();
        // This should create the connection.
        assertNotNull(connection);
        // Verify the broker was created.
        assertNotNull( BrokerRegistry.getInstance().lookup("localhost") );
        connection.close();
View Full Code Here


        assertNull( BrokerRegistry.getInstance().lookup("localhost") );
    }
   
    public void testGetBrokerName() throws URISyntaxException, JMSException {
        ActiveMQXAConnectionFactory cf = new ActiveMQXAConnectionFactory("vm://localhost?broker.persistent=false");
        ActiveMQConnection connection = (ActiveMQConnection) cf.createConnection();
        connection.start();
       
        String brokerName = connection.getBrokerName();
        log.info("Got broker name: " + brokerName);
       
View Full Code Here

       
        log.info("connection URI is: " + connectURI);
       
        // This should create the connection.
        ActiveMQXAConnectionFactory cf = new ActiveMQXAConnectionFactory(connectURI);
        Connection connection = cf.createConnection();
       
        assertXAConnection(connection);
       
        assertNotNull(connection);
        connection.close();
View Full Code Here

     */
    public void testXAPrepareFailure() throws Exception {

        assertNotNull(connectionUri);
        ActiveMQXAConnectionFactory cf = new ActiveMQXAConnectionFactory("failover:(" + connectionUri + ")");
        ActiveMQXAConnection xaConnection = (ActiveMQXAConnection)cf.createConnection();
        xaConnection.start();
        XASession session = xaConnection.createXASession();
        XAResource resource = session.getXAResource();
        Xid tid = createXid();
        resource.start(tid, XAResource.TMNOFLAGS);
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.