Package javax.jms

Examples of javax.jms.XAConnectionFactory.createXAConnection()


         // Step 3. Perform a lookup on the XA Connection Factory
         XAConnectionFactory cf = (XAConnectionFactory)initialContext.lookup("/XAConnectionFactory");

         // Step 4.Create a JMS XAConnection
         connection = cf.createXAConnection();

         // Step 5. Start the connection
         connection.start();

         // Step 6. Create a JMS XASession
View Full Code Here


         // Step 3. Perform a lookup on the XA Connection Factory
         XAConnectionFactory cf = (XAConnectionFactory)initialContext.lookup("/XAConnectionFactory");

         // Step 4.Create a JMS XAConnection
         connection = cf.createXAConnection();

         // Step 5. Start the connection
         connection.start();

         // Step 6. Create a JMS XASession
View Full Code Here

     * 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

      if (factory instanceof XAConnectionFactory)
      {
         XAConnectionFactory qFactory = (XAConnectionFactory) factory;
         if (username != null)
            connection = qFactory.createXAConnection(username, password);
         else
            connection = qFactory.createXAConnection();

         log.debug("created XAConnection: " + connection);
      }
View Full Code Here

      {
         XAConnectionFactory qFactory = (XAConnectionFactory) factory;
         if (username != null)
            connection = qFactory.createXAConnection(username, password);
         else
            connection = qFactory.createXAConnection();

         log.debug("created XAConnection: " + connection);
      }
      else if (factory instanceof ConnectionFactory)
      {
View Full Code Here

      ConnectionFactory genericFactory = (ConnectionFactory)JMSTestCase.ic.lookup("/ConnectionFactory");
      genericConnection = genericFactory.createConnection();
      assertConnectionType(genericConnection, "generic");

      XAConnectionFactory xaFactory = (XAConnectionFactory)JMSTestCase.ic.lookup("/CF_XA_TRUE");
      xaConnection = xaFactory.createXAConnection();
      assertConnectionType(xaConnection, "xa");

      QueueConnectionFactory queueCF = (QueueConnectionFactory)JMSTestCase.ic.lookup("/CF_QUEUE");
      queueConnection = queueCF.createQueueConnection();
      assertConnectionType(queueConnection, "queue");
View Full Code Here

                if (mcf.getProperties().getType() == JmsConnectionFactory.QUEUE) {
                    connection = ((XAQueueConnectionFactory)qFactory).createXAQueueConnection(username, password);
                } else if (mcf.getProperties().getType() == JmsConnectionFactory.TOPIC) {
                    connection = ((XATopicConnectionFactory)qFactory).createXATopicConnection(username, password);
                } else {
                    connection = qFactory.createXAConnection(username, password);
                }
            } else {
                if (mcf.getProperties().getType() == JmsConnectionFactory.QUEUE) {
                    connection = ((XAQueueConnectionFactory)qFactory).createXAQueueConnection();
                } else if (mcf.getProperties().getType() == JmsConnectionFactory.TOPIC) {
View Full Code Here

                if (mcf.getProperties().getType() == JmsConnectionFactory.QUEUE) {
                    connection = ((XAQueueConnectionFactory)qFactory).createXAQueueConnection();
                } else if (mcf.getProperties().getType() == JmsConnectionFactory.TOPIC) {
                    connection = ((XATopicConnectionFactory)qFactory).createXATopicConnection();
                } else {
                    connection = qFactory.createXAConnection();
                }
            }

            log.debug("created XAConnection: " + connection);
        } else if (factory instanceof ConnectionFactory) {
View Full Code Here

      try
      {
         XAConnectionFactory xacf = (XAConnectionFactory)cf;

         xaconn = xacf.createXAConnection("nobody", "nobody");

         XASession xasession = xaconn.createXASession();

         MessagingXid xid = new MessagingXid(new byte[]{1}, 1, new byte[]{1});
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.