Exemple #1
0
 /* (non-Javadoc)
  * @see tigase.server.ext.lb.LoadBalancerIfc#selectConnection(tigase.server.Packet, java.util.ArrayList)
  */
 @Override
 public ComponentIOService selectConnection(Packet p, List<ComponentConnection> conns) {
   ComponentIOService result = null;
   int idx = Math.abs(p.getStanzaTo().hashCode() % conns.size());
   ComponentConnection conn = conns.get(idx);
   if (conn.getService() != null && conn.getService().isConnected()) {
     result = conn.getService();
   }
   return result;
 }