Package org.jboss.jms.client

Examples of org.jboss.jms.client.JBossConnection


         conn.start();

         for (int i = 0; i < 3; i++)
         {
            JBossConnection connTest = (JBossConnection)
               getConnection(new Connection[]{conn1, conn2, conn3}, i);

            String locator = ((ClientConnectionDelegate) connTest.getDelegate()).
               getRemotingConnection().getRemotingClient().getInvoker().getLocator().getLocatorURI();

            log.info("Server " + i + " has locator=" + locator);

         }
View Full Code Here


  
  
  
   public void testFailoverFloodTwoServers() throws Exception
   {
      JBossConnection conn = null;

      try
      {
         conn = (JBossConnection)this.createConnectionOnServer(cf, 1);

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

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

         MessageConsumer cons = sessCons.createConsumer(queue[1]);

         MyListener list = new MyListener();

         cons.setMessageListener(list);

         conn.start();

         MessageProducer prod = sessSend.createProducer(queue[1]);

         prod.setDeliveryMode(DeliveryMode.PERSISTENT);

         int count = 0;
        
         Killer killer = new Killer();
        
         Thread t = new Thread(killer);
        
         t.start();
        
         while (!killer.isDone())
         {
            TextMessage tm = sessSend.createTextMessage("message " + count);
            tm.setIntProperty("cnt", count);

            prod.send(tm);
           
            if (count % 100 == 0)
            {
               log.info("sent " + count + " server id " + conn.getServerID());
            }
           
            count++;
           
            //Thread.sleep(5);
         }
        
         log.info("done send");
        
         log.info("Waiting to join thread");
         t.join(5 * 60 * 60 * 1000);
         log.info("joined");
        
         if (killer.failed)
         {
            fail();
         }
        
         //We check that we received all the message
         //we allow for duplicates, see http://jira.jboss.org/jira/browse/JBMESSAGING-604
         //We are using auto_ack with a listener so duplicates are ok
        
         if (!list.waitFor(count - 1))
         {
           fail("Timed out waiting for message");
         }
        
         conn.close();
         conn = null;
        
                 
         count = 0;
         Iterator iter = list.msgs.iterator();
         while (iter.hasNext())
         {
            Integer i = (Integer)iter.next();
           
            if (i.intValue() != count)
            {
               fail("Missing message " + i);
            }
            count++;
         }
        
         if (list.failed)
         {
            fail();
         }
      }
      catch (Exception e)
      {
         log.error("Failed", e);
         throw e;
      }
      finally
      {        
         if (conn != null)
         {
            log.info("closing connection");
            try
            {
               conn.close();
            }
            catch (Exception ignore)
            {
            }
            log.info("closed connection");
View Full Code Here

      }
      finally
      {
         if (conn != null)
         {
            JBossConnection c = (JBossConnection)conn;
            System.out.println("Server id for connectio is : " + c.getServerID());
            conn.close();
         }
      }
   }
View Full Code Here

      try
      {

         conn = cf.createXAConnection();

         JBossConnection jbConn = (JBossConnection)conn;

         ClientConnectionDelegate del = (ClientConnectionDelegate)jbConn.getDelegate();

         ConnectionState state = (ConnectionState)del.getState();

         ResourceManager rm = state.getResourceManager();
View Full Code Here

      try
      {

         conn = cf.createXAConnection();

         JBossConnection jbConn = (JBossConnection)conn;

         ClientConnectionDelegate del = (ClientConnectionDelegate)jbConn.getDelegate();

         ConnectionState state = (ConnectionState)del.getState();

         ResourceManager rm = state.getResourceManager();
View Full Code Here

      try
      {

         conn = cf.createXAConnection();

         JBossConnection jbConn = (JBossConnection)conn;

         ClientConnectionDelegate del = (ClientConnectionDelegate)jbConn.getDelegate();

         ConnectionState state = (ConnectionState)del.getState();

         ResourceManager rm = state.getResourceManager();
View Full Code Here

      try
      {

         conn = cf.createXAConnection();

         JBossConnection jbConn = (JBossConnection)conn;

         ClientConnectionDelegate del = (ClientConnectionDelegate)jbConn.getDelegate();

         ConnectionState state = (ConnectionState)del.getState();

         ResourceManager rm = state.getResourceManager();
View Full Code Here

      try
      {

         conn = cf.createXAConnection();

         JBossConnection jbConn = (JBossConnection)conn;

         ClientConnectionDelegate del = (ClientConnectionDelegate)jbConn.getDelegate();

         ConnectionState state = (ConnectionState)del.getState();

         ResourceManager rm = state.getResourceManager();
View Full Code Here

      try
      {
         xaConn = cf.createXAConnection();

         JBossConnection jbConn = (JBossConnection)xaConn;

         ClientConnectionDelegate del = (ClientConnectionDelegate)jbConn.getDelegate();

         ConnectionState state = (ConnectionState)del.getState();

         ResourceManager rm = state.getResourceManager();
View Full Code Here

      try
      {
         xaConn = cf.createXAConnection();

         JBossConnection jbConn = (JBossConnection)xaConn;

         ClientConnectionDelegate del = (ClientConnectionDelegate)jbConn.getDelegate();

         ConnectionState state = (ConnectionState)del.getState();

         ResourceManager rm = state.getResourceManager();
View Full Code Here

TOP

Related Classes of org.jboss.jms.client.JBossConnection

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.