org.ow2.cmi.lb.strategy
Class LoadFactorSort<T extends org.ow2.cmi.lb.LoadBalanceable>

java.lang.Object
  extended by org.ow2.cmi.lb.strategy.LoadFactorSort<T>
Type Parameters:
T - The type of objects that are load-balanced
All Implemented Interfaces:
org.ow2.cmi.lb.strategy.IStrategy<T>

@Immutable
public class LoadFactorSort<T extends org.ow2.cmi.lb.LoadBalanceable>
extends java.lang.Object
implements org.ow2.cmi.lb.strategy.IStrategy<T>

Defines a strategy that orders the list of servers with the load-factor.

Author:
The new CMI team

Constructor Summary
LoadFactorSort(org.ow2.cmi.controller.common.ClusterViewManager clusterViewManager)
          Constructs a strategy for load-factor.
 
Method Summary
 java.util.List<T> choose(java.util.Collection<T> loadBalanceables)
          Returns a list of LoadBalanceable ordered by their load factor (to be on the decrease).
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoadFactorSort

public LoadFactorSort(org.ow2.cmi.controller.common.ClusterViewManager clusterViewManager)
Constructs a strategy for load-factor.

Parameters:
clusterViewManager - the manager of the cluster view
Method Detail

choose

public java.util.List<T> choose(java.util.Collection<T> loadBalanceables)
Returns a list of LoadBalanceable ordered by their load factor (to be on the decrease).

Specified by:
choose in interface org.ow2.cmi.lb.strategy.IStrategy<T extends org.ow2.cmi.lb.LoadBalanceable>
Parameters:
loadBalanceables - a list of CMIReference
Returns:
a list of CMIReference ordered by load-factor

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009 OW2 Consortium. All Rights Reserved.