Package org.jboss.jms.client

Examples of org.jboss.jms.client.JBossConnectionFactory


  
   public void testUpdateConnectionFactoryOnKill() throws Exception
   {
      Connection conn = createConnectionOnServer(cf, 0);

      JBossConnectionFactory jbcf = (JBossConnectionFactory)cf;

      ClientClusteredConnectionFactoryDelegate cfDelegate =
         (ClientClusteredConnectionFactoryDelegate)jbcf.getDelegate();

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

      Connection conn1 = cf.createConnection();
View Full Code Here


  
   public void testUpdateConnectionFactoryOnStop() throws Exception
   {
      Connection conn = createConnectionOnServer(cf, 0);

      JBossConnectionFactory jbcf = (JBossConnectionFactory)cf;

      ClientClusteredConnectionFactoryDelegate cfDelegate =
         (ClientClusteredConnectionFactoryDelegate)jbcf.getDelegate();

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

      Connection conn1 = cf.createConnection();
View Full Code Here

    */
   public void testUpdateConnectionFactoryRaceCondition() throws Exception
   {
      // This connection needs to be opened, as we need the callback to update CF from this conn
      Connection conn = createConnectionOnServer(cf, 0);
      JBossConnectionFactory jbcf = (JBossConnectionFactory) cf;
      ClientClusteredConnectionFactoryDelegate cfDelegate =
         (ClientClusteredConnectionFactoryDelegate) jbcf.getDelegate();
      assertEquals(2, cfDelegate.getDelegates().length);

      Connection conn1 = cf.createConnection();

      Connection conn2 = cf.createConnection();
View Full Code Here

      }
   }

   public void testRestartServer() throws Exception
   {
      JBossConnectionFactory cf2 = (JBossConnectionFactory) ic[1].lookup("/ConnectionFactory");

      ClientClusteredConnectionFactoryDelegate clusterCF = (ClientClusteredConnectionFactoryDelegate)cf.getDelegate();
      ClientConnectionFactoryDelegate delegates[] = clusterCF.getDelegates();
      clusterCF.closeCallback();

      ServerManagement.kill(1);

      //Restart the server on the same place
      ServiceAttributeOverrides attr = new ServiceAttributeOverrides();
      attr.put(ServiceContainer.REMOTING_OBJECT_NAME, "LocatorURI",delegates[1].getServerLocatorURI());
      ServerManagement.start(1,config,attr,false);

      // The server back on the same remoting port as before
      startDefaultServer(1, attr, false);

      Connection conn = null;
      try
      {
         conn = cf2.createConnection();
      }
      finally
      {
         try
         {
View Full Code Here

   /** testcase for http://jira.jboss.com/jira/browse/JBMESSAGING-1038 */
   public void testHopping() throws Exception
   {

      JBossConnectionFactory localcf = (JBossConnectionFactory)ic[0].lookup("/ClusteredConnectionFactory");
      ClientClusteredConnectionFactoryDelegate cfdelegate = (ClientClusteredConnectionFactoryDelegate)localcf.getDelegate();

      ((ClientClusteredConnectionFactoryDelegate)cf.getDelegate()).closeCallback();

      // After this, the CF won't get any callbacks
      cfdelegate.closeCallback();
View Full Code Here

   /** This method is to make sure CFs are being released on GC, validating if the callbacks
    *  are not making any hard references */
   public void testUpdateTopology() throws Throwable
   {

      JBossConnectionFactory cf = (JBossConnectionFactory)ic[0].lookup("/ClusteredConnectionFactory");
      ClientClusteredConnectionFactoryDelegate clusterDelegate = (ClientClusteredConnectionFactoryDelegate)cf.getDelegate();
      assertEquals(2, clusterDelegate.getDelegates().length);
      clusterDelegate.getTopology();
      assertEquals(2, clusterDelegate.getDelegates().length);

      // Kill the same node as the CF is connected to
View Full Code Here

   /** Case the updateCF is not captured, the hopping should run nicely.
    *  This test will disable CF callback for a connection and validate if hoping is working*/
   public void testNoUpdateCaptured() throws Exception
   {
      JBossConnectionFactory cfNoCallback = (JBossConnectionFactory)ic[0].lookup("/ClusteredConnectionFactory");
      ClientClusteredConnectionFactoryDelegate noCallbackDelegate =  (ClientClusteredConnectionFactoryDelegate )cfNoCallback.getDelegate();
      noCallbackDelegate.closeCallback();

      ServerManagement.kill(1);

      Connection conn = null;

      for (int i=0; i<4; i++)
      {
         try
         {
            conn = cfNoCallback.createConnection();
            // 0 is the only server alive, so.. all connection should be performed on it
            assertEquals(0, getServerId(conn));
         }
         finally
         {
View Full Code Here

  
   public void testUpdateConnectionFactoryOnKill() throws Exception
   {
      Connection conn = createConnectionOnServer(cf, 0);

      JBossConnectionFactory jbcf = (JBossConnectionFactory)cf;

      ClientClusteredConnectionFactoryDelegate cfDelegate =
         (ClientClusteredConnectionFactoryDelegate)jbcf.getDelegate();

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

      Connection conn1 = cf.createConnection();
View Full Code Here

  
   public void testUpdateConnectionFactoryOnStop() throws Exception
   {
      Connection conn = createConnectionOnServer(cf, 0);

      JBossConnectionFactory jbcf = (JBossConnectionFactory)cf;

      ClientClusteredConnectionFactoryDelegate cfDelegate =
         (ClientClusteredConnectionFactoryDelegate)jbcf.getDelegate();

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

      Connection conn1 = cf.createConnection();
View Full Code Here

    */
   public void testUpdateConnectionFactoryRaceCondition() throws Exception
   {
      // This connection needs to be opened, as we need the callback to update CF from this conn
      Connection conn = createConnectionOnServer(cf, 0);
      JBossConnectionFactory jbcf = (JBossConnectionFactory) cf;
      ClientClusteredConnectionFactoryDelegate cfDelegate =
         (ClientClusteredConnectionFactoryDelegate) jbcf.getDelegate();
      assertEquals(2, cfDelegate.getDelegates().length);

      Connection conn1 = cf.createConnection();

      Connection conn2 = cf.createConnection();
View Full Code Here

TOP

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

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.