Package org.jboss.ha.client.loadbalance

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;
      while (target != null)
      {
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

      {
         target = (InvokerLocator) ((AopLoadBalancePolicy) lb).chooseTarget(family.get(), invocation);
      }
      else
      {
         target = (InvokerLocator) lb.chooseTarget(family.get());
      }
     
      Throwable lastException = null;
      while (target != null)
      {
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

   {
      testCount++;
      FamilyClusterInfo fci = ClusteringTargetsRepository.initTarget(FAMILY_BASE + testCount, Arrays.asList(TARGETS));
     
      LoadBalancePolicy lbp = getLoadBalancePolicy();
      Object target = lbp.chooseTarget(fci);
     
      for (int i = 0; i < 10000; i++)
      {
         assertSame(target, getLoadBalancePolicy().chooseTarget(fci));
      }
View Full Code Here

   {
      testCount++;
      FamilyClusterInfo fci = ClusteringTargetsRepository.initTarget(FAMILY_BASE + testCount, Arrays.asList(TARGETS));
     
      LoadBalancePolicy lbp1 = getLoadBalancePolicy();
      Object target1 = lbp1.chooseTarget(fci);
     
      LoadBalancePolicy lbp2 = getLoadBalancePolicy();
     
      assertSame(target1, lbp2.chooseTarget(fci));
     
View Full Code Here

      LoadBalancePolicy lbp1 = getLoadBalancePolicy();
      Object target1 = lbp1.chooseTarget(fci);
     
      LoadBalancePolicy lbp2 = getLoadBalancePolicy();
     
      assertSame(target1, lbp2.chooseTarget(fci));
     
      fci.removeDeadTarget(target1);
     
      Object target3 = lbp1.chooseTarget(fci);
     
View Full Code Here

     
      Object target3 = lbp1.chooseTarget(fci);
     
      assertFalse(target1.equals(target3));
     
      assertSame(target3, lbp2.chooseTarget(fci));
     
   }

  
}
View Full Code Here

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

      Object target = lbp.chooseTarget(fci);
     
      assertTrue(targets.contains(target));
     
      for (int i = 0; i < 10; i++)
         assertEquals(target, lbp.chooseTarget(fci));
   }
  
   public void testInitialSelection()
   {
      testCount++;
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.