Package javax.jms

Examples of javax.jms.XATopicConnectionFactory


    try {
      if (isHa) {
        if (collocated) {
          if (ra.haURL != null) {
            if (cxRequest instanceof TopicConnectionRequest) {
              XATopicConnectionFactory factory = XATopicHATcpConnectionFactory.create(ra.haURL);
              setParameters(factory);
              ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
              cnx = factory.createXATopicConnection(userName, password);
            } else {
              XAConnectionFactory factory = XAHATcpConnectionFactory.create(ra.haURL);
              setParameters(factory);
              ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
              cnx = factory.createXAConnection(userName, password);
            }
          } else {
            if (cxRequest instanceof TopicConnectionRequest) {
              XATopicConnectionFactory factory = XATopicHALocalConnectionFactory.create();
              setParameters(factory);
              ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
              cnx = factory.createXATopicConnection(userName, password);
            } else {
              XAConnectionFactory factory = XAHALocalConnectionFactory.create();
              setParameters(factory);
              ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
              cnx = factory.createXAConnection(userName, password);
            }
          }
        } else {
          String urlHa = "hajoram://" + hostName + ":" + serverPort;
          if (cxRequest instanceof TopicConnectionRequest) {
            XATopicConnectionFactory factory = XATopicHATcpConnectionFactory.create(urlHa);
            setParameters(factory);
            ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
            cnx = factory.createXATopicConnection(userName, password);
          } else {
            XAConnectionFactory factory = XAHATcpConnectionFactory.create(urlHa);
            setParameters(factory);
            ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
            cnx = factory.createXAConnection(userName, password);
          }
        }
      } else {
        if (collocated) {
          if (cxRequest instanceof TopicConnectionRequest) {
            XATopicConnectionFactory factory = XATopicLocalConnectionFactory.create();
            setParameters(factory);
            ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
            cnx = factory.createXATopicConnection(userName, password);
          } else {
            XAConnectionFactory factory = XALocalConnectionFactory.create();
            setParameters(factory);
            ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
            cnx = factory.createXAConnection(userName, password);
          }
        } else {
          if (cxRequest instanceof TopicConnectionRequest) {
            XATopicConnectionFactory factory = XATopicTcpConnectionFactory.create(hostName, serverPort);
            setParameters(factory);
            ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
            cnx = factory.createXATopicConnection(userName, password);
          } else {
            XAConnectionFactory factory = XATcpConnectionFactory.create(hostName, serverPort);
            setParameters(factory);
            ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
            cnx = factory.createXAConnection(userName, password);
          }
        }
      }
      if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG))
        AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG,
View Full Code Here


   }

   public void testXAResourceSuspendWorkCommit() throws Exception
   {
      InitialContext context = getInitialContext();
      XATopicConnectionFactory factory = (XATopicConnectionFactory) context.lookup(XA_TOPIC_FACTORY);
      Topic topic = (Topic) context.lookup(TEST_TOPIC);

      XATopicConnection connection = factory.createXATopicConnection();
      try
      {
         // Set up
         XATopicSession xaSession = connection.createXATopicSession();
         TopicSession session = xaSession.getTopicSession();
View Full Code Here

   }

   public void testXAResourceRollbackAfterPrepare() throws Exception
   {
      InitialContext context = getInitialContext();
      XATopicConnectionFactory factory = (XATopicConnectionFactory) context.lookup(XA_TOPIC_FACTORY);
     
      Topic topic = (Topic) context.lookup(TEST_TOPIC);

      XATopicConnection connection = factory.createXATopicConnection();
      try
      {
         // Set up
         XATopicSession xaSession = connection.createXATopicSession();
View Full Code Here

      log.debug("Got topic connection factory " + tcf + " from " + topicFactoryRef);
      log.debug("Attempting to create topic connection with user " + user);
      TopicConnection result;
      if (tcf instanceof XATopicConnectionFactory && isDeliveryTransacted)
      {
         XATopicConnectionFactory xatcf = (XATopicConnectionFactory) tcf;
         if (user != null)
            result = xatcf.createXATopicConnection(user, pass);
         else
            result = xatcf.createXATopicConnection();
      }
      else
      {
         if (user != null)
            result = tcf.createTopicConnection(user, pass);
View Full Code Here

      XAQueueConnectionFactory xaQueueCF = (XAQueueConnectionFactory)JMSTestCase.ic.lookup("/CF_QUEUE_XA_TRUE");
      xaQueueConnection = xaQueueCF.createXAQueueConnection();
      assertConnectionType(xaQueueConnection, "xa-queue");

      XATopicConnectionFactory xaTopicCF = (XATopicConnectionFactory)JMSTestCase.ic.lookup("/CF_TOPIC_XA_TRUE");
      xaTopicConnection = xaTopicCF.createXATopicConnection();
      assertConnectionType(xaTopicConnection, "xa-topic");

      genericConnection.close();
      xaConnection.close();
      queueConnection.close();
View Full Code Here

            // create the queue XA connection factory
            XAQueueConnectionFactory xaQueueConnectionFactory = AQjmsFactory.getXAQueueConnectionFactory(xaDs);
            context.rebind(XA_QUEUE_CONNECTION_FACTORY, xaQueueConnectionFactory);

//          create the topic XA connection factory
            XATopicConnectionFactory xaTopicConnectionFactory = AQjmsFactory.getXATopicConnectionFactory(xaDs);
            context.rebind(XA_TOPIC_CONNECTION_FACTORY, xaTopicConnectionFactory);

            // create the topic connection factory
            topicFactory = AQjmsFactory.getTopicConnectionFactory(ds);
            context.rebind(TOPIC_CONNECTION_FACTORY, topicFactory);
View Full Code Here

   }

   public void testXAResourceRollbackAfterPrepare() throws Exception
   {
      InitialContext context = getInitialContext();
      XATopicConnectionFactory factory = (XATopicConnectionFactory) context.lookup(XA_TOPIC_FACTORY);
     
      Topic topic = (Topic) context.lookup(TEST_TOPIC);

      XATopicConnection connection = factory.createXATopicConnection();
      try
      {
         // Set up
         XATopicSession xaSession = connection.createXATopicSession();
View Full Code Here

      XAQueueConnectionFactory xaQueueCF = (XAQueueConnectionFactory)JMSTestCase.ic.lookup("/CF_QUEUE_XA_TRUE");
      xaQueueConnection = xaQueueCF.createXAQueueConnection();
      assertConnectionType(xaQueueConnection, "xa-queue");

      XATopicConnectionFactory xaTopicCF = (XATopicConnectionFactory)JMSTestCase.ic.lookup("/CF_TOPIC_XA_TRUE");
      xaTopicConnection = xaTopicCF.createXATopicConnection();
      assertConnectionType(xaTopicConnection, "xa-topic");

      genericConnection.close();
      xaConnection.close();
      queueConnection.close();
View Full Code Here

      log.debug("Got topic connection factory " + tcf + " from " + topicFactoryRef);
      log.debug("Attempting to create topic connection with user " + user);
      TopicConnection result;
      if (tcf instanceof XATopicConnectionFactory && isDeliveryTransacted)
      {
         XATopicConnectionFactory xatcf = (XATopicConnectionFactory) tcf;
         if (user != null)
            result = xatcf.createXATopicConnection(user, pass);
         else
            result = xatcf.createXATopicConnection();
      }
      else
      {
         if (user != null)
            result = tcf.createTopicConnection(user, pass);
View Full Code Here

      TopicConnection connection;

      if (factory instanceof XATopicConnectionFactory)
      {
         XATopicConnectionFactory tFactory = (XATopicConnectionFactory) factory;
         if (username != null)
            connection = tFactory.createXATopicConnection(username, password);
         else
            connection = tFactory.createXATopicConnection();

         log.debug("created XATopicConnection: " + connection);
      }
      else if (factory instanceof TopicConnectionFactory)
      {
         TopicConnectionFactory tFactory = (TopicConnectionFactory) factory;
         if (username != null)
            connection = tFactory.createTopicConnection(username, password);
         else
            connection = tFactory.createTopicConnection();

         log.debug("created TopicConnection: " + connection);
      }
      else
         throw new IllegalArgumentException("factory is invalid");
View Full Code Here

TOP

Related Classes of javax.jms.XATopicConnectionFactory

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.