Package javax.jms

Examples of javax.jms.XAConnectionFactory.createXAConnection()


     * as they originate from the same session.
     */
    public void testIsSameRMSingleCF() throws Exception
    {
        XAConnectionFactory factory = getConnectionFactory(FACTORY_NAME);
        XAConnection conn = factory.createXAConnection("guest","guest");
        XASession session = conn.createXASession();
        XAResource xaResource1 = session.getXAResource();
        XAResource xaResource2 = session.getXAResource();

        assertEquals("XAResource objects not equal", xaResource1, xaResource2);
View Full Code Here


        XAConnectionFactory factory2 = new AMQConnectionFactory(url);
        XAConnectionFactory factory3 = getConnectionFactory(ALT_FACTORY_NAME);

        XAConnection conn = factory.createXAConnection("guest","guest");
        XAConnection conn2 = factory2.createXAConnection("guest","guest");
        XAConnection conn3 = factory3.createXAConnection("guest","guest");

        XASession session = conn.createXASession();
        XASession session2 = conn2.createXASession();
        XASession session3 = conn3.createXASession();
View Full Code Here

        mcf.setResourceAdapter(ra);
        QpidRAManagedConnection mc = (QpidRAManagedConnection)mcf.createManagedConnection(null, null);
        AMQXAResource xa1 = (AMQXAResource)mc.getXAResource();

        XAConnectionFactory factory = getConnectionFactory(FACTORY_NAME);
        XAConnection connection = factory.createXAConnection("guest", "guest");
        XASession s2 = connection.createXASession();
        AMQXAResource xaResource = (AMQXAResource)connection.createXASession().getXAResource();

        assertTrue("QpidRAXAResource and XAResource should be from the same RM", xa1.isSameRM(xaResource));
        assertTrue("XAResource and QpidRAXAResource should be from the same RM", xaResource.isSameRM(xa1));
View Full Code Here

        mcf.setResourceAdapter(ra);
        QpidRAManagedConnection mc = (QpidRAManagedConnection)mcf.createManagedConnection(null, null);
        AMQXAResource xa1 = (AMQXAResource)mc.getXAResource();

        XAConnectionFactory factory = getConnectionFactory(FACTORY_NAME);
        XAConnection connection = factory.createXAConnection("guest", "guest");
        XASession s2 = connection.createXASession();
        AMQXAResource xaResource = (AMQXAResource)connection.createXASession().getXAResource();

        assertTrue("QpidRAXAResource and XAResource should be from the same RM", xa1.isSameRM(xaResource));
        assertTrue("XAResource and QpidRAXAResource should be from the same RM", xaResource.isSameRM(xa1));
View Full Code Here

        XAConnectionFactory xaConnectionFactory = (XAConnectionFactory) xaFactory;

        XAConnection xaConnection;
        if (user == null || password == null) {
            if (log.isDebugEnabled()) { log.debug("creating new JMS XAConnection with no credentials"); }
            xaConnection = xaConnectionFactory.createXAConnection();
        }
        else {
            if (log.isDebugEnabled()) { log.debug("creating new JMS XAConnection with user <" + user + "> and password <" + password + ">"); }
            xaConnection = xaConnectionFactory.createXAConnection(user, password);
        }
View Full Code Here

            if (log.isDebugEnabled()) { log.debug("creating new JMS XAConnection with no credentials"); }
            xaConnection = xaConnectionFactory.createXAConnection();
        }
        else {
            if (log.isDebugEnabled()) { log.debug("creating new JMS XAConnection with user <" + user + "> and password <" + password + ">"); }
            xaConnection = xaConnectionFactory.createXAConnection(user, password);
        }

        JmsPooledConnection jmsPooledConnection = new JmsPooledConnection(this, xaConnection);
        xaStatefulHolders.add(jmsPooledConnection);
        return jmsPooledConnection;
View Full Code Here

         // Step 4. Look up the Queue
         Queue queue = (Queue)ic.lookup("queue/testQueue");

         // Step 5. Create a XA connection, a XA session and a message producer for the queue
         xaConnection = xacf.createXAConnection();
         XASession session = xaConnection.createXASession();
         MessageProducer messageProducer = session.createProducer(queue);

         // Step 6. Create a "fake" XAResource which will crash the server in its commit phase
         XAResource failingXAResource = new FailingXAResource();
View Full Code Here

            ctx = getContext(0);

            XAConnectionFactory cf = (XAConnectionFactory)ctx.lookup("/ConnectionFactory");

            conn = cf.createXAConnection();

            sess = conn.createXASession();

            activeXAResource = sess.getXAResource();
View Full Code Here

        XAConnectionFactory factory = getConnectionFactory();
        IntrospectionSupport.setProperties(factory, headers, "factory.");

        if (login != null) {
            connection = factory.createXAConnection(login, passcode);
        }
        else {
            connection = factory.createXAConnection();
        }
        if (clientId != null) {
View Full Code Here

        if (login != null) {
            connection = factory.createXAConnection(login, passcode);
        }
        else {
            connection = factory.createXAConnection();
        }
        if (clientId != null) {
            connection.setClientID(clientId);
        }
        IntrospectionSupport.setProperties(connection, headers, "connection.");
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.