Examples of chooseTarget()


Examples of org.jboss.ha.client.loadbalance.LoadBalancePolicy.chooseTarget()

      for (int i = 0; i < 5; i++)
         assertEquals(target, lbp.chooseTarget(fci));
     
      fci.removeDeadTarget(target);
      Object thirdTarget;
      target = thirdTarget = lbp.chooseTarget(fci);
     
      assertFalse(firstTarget.equals(thirdTarget));
      assertFalse(secondTarget.equals(thirdTarget));
      assertTrue(targets.contains(target));
     
View Full Code Here

Examples of org.jboss.ha.client.loadbalance.LoadBalancePolicy.chooseTarget()

      assertFalse(firstTarget.equals(thirdTarget));
      assertFalse(secondTarget.equals(thirdTarget));
      assertTrue(targets.contains(target));
     
      for (int i = 0; i < 5; i++)
         assertEquals(target, lbp.chooseTarget(fci));
     
      fci.removeDeadTarget(target);
     
      assertNull(lbp.chooseTarget(fci));
   }
View Full Code Here

Examples of org.jboss.ha.client.loadbalance.LoadBalancePolicy.chooseTarget()

      for (int i = 0; i < 5; i++)
         assertEquals(target, lbp.chooseTarget(fci));
     
      fci.removeDeadTarget(target);
     
      assertNull(lbp.chooseTarget(fci));
   }
  
   public void testNoAvailableTargets()
   {
      testCount++;
View Full Code Here

Examples of org.jboss.ha.client.loadbalance.LoadBalancePolicy.chooseTarget()

         {
            target = (InvokerLocator) ((AopLoadBalancePolicy) lb).chooseTarget(family.get(), invocation);
         }
         else
         {
            target = (InvokerLocator) lb.chooseTarget(family.get());
         }
      }
     
      Throwable lastException = null;
      boolean failoverAuthorized = true;
View Full Code Here

Examples of org.jboss.ha.client.loadbalance.LoadBalancePolicy.chooseTarget()

         if (!definitivlyRemoveNodeOnFailure)
         {
            family.get().resetView();
         }

         target = (InvokerLocator) lb.chooseTarget(family.get());
         if (target == null)
         {
            if (lastException != null)
            {
               throw new RuntimeException("cluster invocation failed, last exception was: ", lastException);
View Full Code Here

Examples of org.jboss.ha.client.loadbalance.LoadBalancePolicy.chooseTarget()

         {
            target = (InvokerLocator) ((AopLoadBalancePolicy) lb).chooseTarget(family.get(), invocation);
         }
         else
         {
            target = (InvokerLocator) lb.chooseTarget(family.get());
         }
      }
     
      Throwable lastException = null;
      boolean failoverAuthorized = true;
View Full Code Here

Examples of org.jboss.ha.client.loadbalance.LoadBalancePolicy.chooseTarget()

         if (!definitivlyRemoveNodeOnFailure)
         {
            family.get().resetView();
         }

         target = (InvokerLocator) lb.chooseTarget(family.get());
         if (target == null)
         {
            if (lastException != null)
            {
               throw new RuntimeException("cluster invocation failed, last exception was: ", lastException);
View Full Code Here

Examples of org.jboss.ha.client.loadbalance.LoadBalancePolicy.chooseTarget()

      FamilyClusterInfo fci = ClusteringTargetsRepository.initTarget(FAMILY_BASE + testCount, Arrays.asList(TARGETS));
      LoadBalancePolicy lbp = getLoadBalancePolicy();
      int expectedCursor = -1;
      for (int i = 0; i < 100; i++)
      {
         Object target = lbp.chooseTarget(fci);
         if (expectedCursor < 0)
         {
            expectedCursor = fci.getCursor();
         }
         else
View Full Code Here

Examples of org.jboss.ha.client.loadbalance.LoadBalancePolicy.chooseTarget()

      testCount++;
      List<String> targets = new ArrayList<String>(Arrays.asList(TARGETS));
      FamilyClusterInfo fci = ClusteringTargetsRepository.initTarget(FAMILY_BASE + testCount, targets);
      LoadBalancePolicy lbp = getLoadBalancePolicy();
     
      String target = (String) lbp.chooseTarget(fci);
      int cursor = fci.getCursor();
      assertEquals(target, fci.getTargets().get(cursor));
     
      while (targets.size() > 1)
      {
View Full Code Here

Examples of org.jboss.ha.client.loadbalance.LoadBalancePolicy.chooseTarget()

         targets.remove(target);
         assertEquals(targets, fci.getTargets());
        
         int expectedCursor = ++cursor % targets.size();
        
         target = (String) lbp.chooseTarget(fci);
         cursor = fci.getCursor();
         assertEquals(expectedCursor, cursor);
         assertEquals(target, fci.getTargets().get(cursor));
      }
   }
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.