|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.carol.cmi.lb.policy.RoundRobinPolicy<T>
T - The type of object that was load-balanced@ThreadSafe public final class RoundRobinPolicy<T extends org.ow2.carol.cmi.lb.LoadBalanceable>
The default load-balancing policy (Round Robin) that always chooses the next available load-balanceable.
| Constructor Summary | |
|---|---|
RoundRobinPolicy()
Build a default load-balancing policy (the Round Robin policy). |
|
| Method Summary | ||
|---|---|---|
T |
choose(java.util.List<T> loadBalanceables)
Chooses the next load-balanceable among the list of load-balanceables. |
|
BasicDecisionManager<java.lang.Void> |
onInvokeException(java.lang.reflect.Method method,
java.lang.Object[] parameters,
T loadBalanceable,
java.lang.Throwable thr)
Returns a decision when an exception is thrown during an invocation for a given load-balanceable. |
|
BasicDecisionManager<java.lang.Void> |
onLookupException(T loadBalanceable,
java.lang.Throwable thr)
Returns a decision when an exception is thrown during an access to a registry for a given load-balanceable. |
|
|
onReturn(java.lang.reflect.Method method,
java.lang.Object[] parameters,
T loadBalanceable,
ReturnType retVal)
Returns a decision when the invocation of a remote method ends. |
|
void |
setStrategy(org.ow2.carol.cmi.lb.strategy.ILBStrategy<T> lbStrategy)
Sets a strategy to modify the behavior of this policy. |
|
java.lang.String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RoundRobinPolicy()
| Method Detail |
|---|
public T choose(java.util.List<T> loadBalanceables)
throws org.ow2.carol.cmi.lb.NoLoadBalanceableException
choose in interface org.ow2.carol.cmi.lb.policy.ILBPolicy<T extends org.ow2.carol.cmi.lb.LoadBalanceable>loadBalanceables - the list of load-balanceables
org.ow2.carol.cmi.lb.NoLoadBalanceableException - if no server available
public BasicDecisionManager<java.lang.Void> onInvokeException(java.lang.reflect.Method method,
java.lang.Object[] parameters,
T loadBalanceable,
java.lang.Throwable thr)
onInvokeException in interface org.ow2.carol.cmi.lb.policy.ILBPolicy<T extends org.ow2.carol.cmi.lb.LoadBalanceable>method - the method that was invokedparameters - the parameters of the methodloadBalanceable - the load-balanceable that have caused the exceptionthr - the exception that is thrown
public <ReturnType> BasicDecisionManager<ReturnType> onReturn(java.lang.reflect.Method method,
java.lang.Object[] parameters,
T loadBalanceable,
ReturnType retVal)
onReturn in interface org.ow2.carol.cmi.lb.policy.ILBPolicy<T extends org.ow2.carol.cmi.lb.LoadBalanceable>ReturnType - the type of the returned valuemethod - the method that was invokedparameters - the parameters of the methodloadBalanceable - the load-balanceable used for the invocationretVal - the returned value
public BasicDecisionManager<java.lang.Void> onLookupException(T loadBalanceable,
java.lang.Throwable thr)
onLookupException in interface org.ow2.carol.cmi.lb.policy.ILBPolicy<T extends org.ow2.carol.cmi.lb.LoadBalanceable>loadBalanceable - the load-balanceable that have caused the exceptionthr - the exception that is thrown
public void setStrategy(org.ow2.carol.cmi.lb.strategy.ILBStrategy<T> lbStrategy)
setStrategy in interface org.ow2.carol.cmi.lb.policy.ILBPolicy<T extends org.ow2.carol.cmi.lb.LoadBalanceable>lbStrategy - a strategy of load-balancingpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||