All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.remoting.transporter.DefaultLoadBalancer Maven / Gradle / Ivy

There is a newer version: 5.0.29.Final
Show newest version
package org.jboss.remoting.transporter;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Random;

public class DefaultLoadBalancer implements LoadBalancer, Serializable
{
   private static final long serialVersionUID = -7219455363024542925L;

   public int selectServer(ArrayList servers)
   {
      int index = 0;

      if (servers != null)
      {
         int size = servers.size();
         if (size > 1)
         {
            index = new Random().nextInt(size);
         }
      }

      return index;
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy