Examples of XAQueueConnectionFactory


Examples of javax.jms.XAQueueConnectionFactory

      QueueConnection connection;

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

         log.debug("created XAQueueConnection: " + connection);
      }
      else if (factory instanceof QueueConnectionFactory)
      {
         QueueConnectionFactory qFactory = (QueueConnectionFactory) factory;
         if (username != null)
            connection = qFactory.createQueueConnection(username, password);
         else
            connection = qFactory.createQueueConnection();

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

Examples of javax.jms.XAQueueConnectionFactory

      TopicConnectionFactory topicCF = (TopicConnectionFactory)JMSTestCase.ic.lookup("/CF_TOPIC");
      topicConnection = topicCF.createTopicConnection();
      assertConnectionType(topicConnection, "topic");

      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");
View Full Code Here

Examples of javax.jms.XAQueueConnectionFactory

/* 138 */     log.debug("using connection factory: " + factory);
/* 139 */     log.debug("using username/password: " + String.valueOf(username) + "/-- not shown --");
/*     */
/* 143 */     if ((factory instanceof XAQueueConnectionFactory))
/*     */     {
/* 145 */       XAQueueConnectionFactory qFactory = (XAQueueConnectionFactory)factory;
/*     */       QueueConnection connection;
/*     */       QueueConnection connection;
/* 146 */       if (username != null)
/* 147 */         connection = qFactory.createXAQueueConnection(username, password);
/*     */       else {
/* 149 */         connection = qFactory.createXAQueueConnection();
/*     */       }
/* 151 */       log.debug("created XAQueueConnection: " + connection);
/*     */     }
/* 153 */     else if ((factory instanceof QueueConnectionFactory))
/*     */     {
/* 155 */       QueueConnectionFactory qFactory = (QueueConnectionFactory)factory;
/*     */       QueueConnection connection;
/*     */       QueueConnection connection;
/* 156 */       if (username != null)
/* 157 */         connection = qFactory.createQueueConnection(username, password);
/*     */       else {
/* 159 */         connection = qFactory.createQueueConnection();
/*     */       }
/* 161 */       log.debug("created QueueConnection: " + connection);
/*     */     }
/*     */     else {
/* 164 */       throw new IllegalArgumentException("factory is invalid");
View Full Code Here

Examples of javax.jms.XAQueueConnectionFactory

/* 490 */     log.debug("Attempting to create queue connection with user " + user);
/*     */     QueueConnection result;
/*     */     QueueConnection result;
/* 492 */     if (((qcf instanceof XAQueueConnectionFactory)) && (this.isDeliveryTransacted))
/*     */     {
/* 494 */       XAQueueConnectionFactory xaqcf = (XAQueueConnectionFactory)qcf;
/*     */       QueueConnection result;
/* 495 */       if (user != null)
/* 496 */         result = xaqcf.createXAQueueConnection(user, pass);
/*     */       else
/* 498 */         result = xaqcf.createXAQueueConnection();
/*     */     }
/*     */     else
/*     */     {
/*     */       QueueConnection result;
/* 502 */       if (user != null)
View Full Code Here

Examples of javax.jms.XAQueueConnectionFactory

        String userName = server.getAttribute("username");
        String password = server.getAttribute("password");
        String clientId = server.getAttribute("client-id");
       
        InitialContext jndi = null;
        XAQueueConnectionFactory factory = null;
        XAQueueConnection con = null;       
       
        try {
            jndi = JNDIContextFactory.getInitialContext(serverName);
            factory = (XAQueueConnectionFactory) jndi.lookup(jndiName);                       
        } catch (GeneralException ge){
            throw new GenericServiceException("Problems getting JNDI InitialContext.", ge.getNested());
        } catch (NamingException ne) {
            JNDIContextFactory.clearInitialContext(serverName);
            try {
                jndi = JNDIContextFactory.getInitialContext(serverName);
                factory = (XAQueueConnectionFactory) jndi.lookup(jndiName);
            } catch (GeneralException ge2){
                throw new GenericServiceException("Problems getting JNDI InitialContext.", ge2.getNested());               
            } catch (NamingException ne2) {
                throw new GenericServiceException("JNDI lookup problems.", ne2);
            }
        }
                       
        try {
            con = factory.createXAQueueConnection(userName, password);

            if (clientId != null && clientId.length() > 1)
                con.setClientID(userName);
            con.start();
View Full Code Here

Examples of javax.jms.XAQueueConnectionFactory

      if (connectionFactory instanceof XAConnectionFactory) {
        log.debug("connection factory '"+connectionFactoryName+"' is a XAConnectionFactory: using xa jms apis");
        if (destination instanceof Queue) {
          log.debug("destination '"+destinationName+"' is a Queue: using xa queue jms apis");
          XAQueueConnectionFactory xaQueueConnectionFactory = (XAQueueConnectionFactory) connectionFactory;
          sendToQueueXA((Queue) destination, xaQueueConnectionFactory);
 
        } else if (destination instanceof Topic) {
          log.debug("destination '"+destinationName+"' is a Topic: using xa topic jms apis");
          XATopicConnectionFactory xaTopicConnectionFactory = (XATopicConnectionFactory) connectionFactory;
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.