|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
T - The type of object that was load-balancedpublic interface IPolicy<T extends LoadBalanceable>
Interface of the policies for load-balancing.
| Method Summary | ||
|---|---|---|
T |
choose(java.util.Collection<T> loadBalanceables)
Chooses a load-balanceable among the list of load-balanceables. |
|
IStrategy<T> |
getStrategy()
Return a strategy to modify the behavior of this policy. |
|
|
onChoose(java.lang.reflect.Method method,
java.lang.Object[] parameters,
ReturnType chosenValue)
Return a decision when a server is chosen and its delegate retrieved. |
|
DecisionManager<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. |
|
DecisionManager<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(IStrategy<T> strategy)
Sets a strategy to modify the behavior of this policy. |
|
| Method Detail |
|---|
T choose(java.util.Collection<T> loadBalanceables)
throws NoLoadBalanceableException
loadBalanceables - a list of load-balanceables
NoLoadBalanceableException - if no server is availableIStrategy<T> getStrategy()
void setStrategy(IStrategy<T> strategy)
strategy - a strategy of load-balancing
DecisionManager<java.lang.Void> onLookupException(T loadBalanceable,
java.lang.Throwable thr)
loadBalanceable - the load-balanceable that have caused the exceptionthr - the exception that is thrown
DecisionManager<java.lang.Void> onInvokeException(java.lang.reflect.Method method,
java.lang.Object[] parameters,
T loadBalanceable,
java.lang.Throwable thr)
method - the method that was invokedparameters - the parameters of the methodloadBalanceable - the load-balanceable that have caused the exceptionthr - the exception that is thrown
<ReturnType> DecisionManager<ReturnType> onChoose(java.lang.reflect.Method method,
java.lang.Object[] parameters,
ReturnType chosenValue)
ReturnType - the type of delegatemethod - the method that was invokedparameters - the parameters of the methodchosenValue - the delegate of chosen server
<ReturnType> DecisionManager<ReturnType> onReturn(java.lang.reflect.Method method,
java.lang.Object[] parameters,
T loadBalanceable,
ReturnType retVal)
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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||