Package javax.jms

Examples of javax.jms.ConnectionFactory.createConnection()


      ServerManagement.deployQueue("Queue", 10000, 1000, 1000);
     
      Queue queue = (Queue)initialContext.lookup("/queue/Queue");
     
      Connection conn = cf.createConnection();

      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

      MessageProducer prod = sess.createProducer(queue);
View Full Code Here


     
      final int numRelayers = 5;
     
      final int numConsumers = 20;
     
      Connection conn = cf.createConnection();
     
      class Relayer implements MessageListener
      {
         boolean done;
        
View Full Code Here

            conn = ((XAConnectionFactory)cf).createXAConnection();
         }
         else
         {
            if (trace) { log.trace("Creating a non XA connection"); }
            conn = cf.createConnection();           
         }
      }
      else
      {
         if (qualityOfServiceMode == QOS_ONCE_AND_ONLY_ONCE)
View Full Code Here

            conn = ((XAConnectionFactory)cf).createXAConnection(username, password);
         }
         else
         {
            if (trace) { log.trace("Creating a non XA connection"); }
            conn = cf.createConnection(username, password);           
        
      }
      return conn;
   }
   
View Full Code Here

         Process p = spawnVM(serialized);

         // read the message from the queue

         Connection conn = cf.createConnection();
         conn.start();
         Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageConsumer cons = sess.createConsumer(queue);
         TextMessage tm = (TextMessage)cons.receive(5000);
View Full Code Here

   {
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
      Queue queue = (Queue)ic.lookup("/queue/StressTestQueue");
      drainDestination(cf, queue);

      Connection conn = cf.createConnection();

      Session[] sessions = new Session[PRODUCER_COUNT];
      MessageProducer[] producers = new MessageProducer[PRODUCER_COUNT];

      for(int i = 0; i < PRODUCER_COUNT; i++)
View Full Code Here

         ConnectionFactory cf = (ConnectionFactory)ic0.lookup("/ConnectionFactory");
         Queue queue0 = (Queue)ic0.lookup("/queue/testDistributedQueue");
         Queue queue1 = (Queue)ic1.lookup("/queue/testDistributedQueue");

         conn = cf.createConnection();

         // make sure we're connecting to node 1

         assertEquals(0, ((JBossConnection)conn).getServerID());
View Full Code Here

         conn.close();

         // create a connection to a different node

         conn = cf.createConnection();

         // make sure we're connecting to node 1

         assertEquals(1, ((JBossConnection)conn).getServerID());
View Full Code Here

      assertEquals(3, cfDelegate.getDelegates().length);

      ConnectionFactory httpCF = (ConnectionFactory)ic[0].lookup("/HTTPConnectionFactory");
      JBossConnectionFactory jbhttpCF = (JBossConnectionFactory) httpCF;
     
      Connection httpConn = httpCF.createConnection();

      ClientClusteredConnectionFactoryDelegate httpcfDelegate =
         (ClientClusteredConnectionFactoryDelegate)jbhttpCF.getDelegate();

      assertEquals(3, httpcfDelegate.getDelegates().length);
View Full Code Here


      validateCFs(cfDelegate, httpcfDelegate);

      Connection conn1 = cf.createConnection();
      Connection httpConn1 = httpCF.createConnection();

      assertEquals(1, getServerId(conn1));
      assertEquals(1, getServerId(httpConn1));

      ServerManagement.killAndWait(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.