Package org.jboss.ha.client.loadbalance

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


      Set<Object> selected = new HashSet<Object>();
     
      for (int i = 0; i < 10000; i++)
      {
         LoadBalancePolicy lbp = getLoadBalancePolicy();
         selected.add(lbp.chooseTarget(fci));
         if (selected.size() == TARGETS.length)
            break;
      }
     
      assertEquals(TARGETS.length, selected.size());
View Full Code Here


      List<String> targets = Arrays.asList(TARGETS);
      FamilyClusterInfo fci = ClusteringTargetsRepository.initTarget(FAMILY_BASE + testCount, targets);
     
      LoadBalancePolicy lbp = getLoadBalancePolicy();
      Object firstTarget;
      Object target = firstTarget = lbp.chooseTarget(fci);
     
      assertTrue(targets.contains(target));
     
      for (int i = 0; i < 5; i++)
         assertEquals(target, lbp.chooseTarget(fci));
View Full Code Here

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

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

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

      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

      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

      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

         {
            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

         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

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.