|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.cmi.lb.policy.AbstractPolicy<T>
T - The type of objects that are load-balancedpublic abstract class AbstractPolicy<T extends org.ow2.cmi.lb.LoadBalanceable>
Abstract implementation of a IPolicy, using the class DecisionUtil to take a decision and the class BasicDecisionManager to execute the decision.
DecisionUtil,
BasicDecisionManager| Constructor Summary | |
|---|---|
AbstractPolicy()
Default constructor. |
|
AbstractPolicy(org.ow2.cmi.controller.common.ClusterViewManager clusterViewManager)
|
|
| Method Summary | ||
|---|---|---|
abstract T |
choose(java.util.Collection<T> loadBalanceables)
Chooses a load-balanceable among the list of load-balanceables. |
|
org.ow2.cmi.lb.strategy.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. |
|
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 |
setClusterViewManager(org.ow2.cmi.controller.common.ClusterViewManager clusterViewManager)
Set the manager of the cluster view. |
|
void |
setStrategy(org.ow2.cmi.lb.strategy.IStrategy<T> strategy)
Sets a strategy to modify the behavior of this policy. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractPolicy()
public AbstractPolicy(org.ow2.cmi.controller.common.ClusterViewManager clusterViewManager)
clusterViewManager - the manager of the cluster view| Method Detail |
|---|
public abstract T choose(java.util.Collection<T> loadBalanceables)
throws org.ow2.cmi.lb.NoLoadBalanceableException
choose in interface org.ow2.cmi.lb.policy.IPolicy<T extends org.ow2.cmi.lb.LoadBalanceable>loadBalanceables - a list of load-balanceables
org.ow2.cmi.lb.NoLoadBalanceableException - if no server is 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.cmi.lb.policy.IPolicy<T extends org.ow2.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> org.ow2.cmi.lb.decision.DecisionManager<ReturnType> onChoose(java.lang.reflect.Method method,
java.lang.Object[] parameters,
ReturnType chosenValue)
onChoose in interface org.ow2.cmi.lb.policy.IPolicy<T extends org.ow2.cmi.lb.LoadBalanceable>ReturnType - the type of delegatemethod - the method that was invokedparameters - the parameters of the methodchosenValue - the delegate of chosen server
public <ReturnType> BasicDecisionManager<ReturnType> onReturn(java.lang.reflect.Method method,
java.lang.Object[] parameters,
T loadBalanceable,
ReturnType retVal)
onReturn in interface org.ow2.cmi.lb.policy.IPolicy<T extends org.ow2.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.cmi.lb.policy.IPolicy<T extends org.ow2.cmi.lb.LoadBalanceable>loadBalanceable - the load-balanceable that have caused the exceptionthr - the exception that is thrown
public void setStrategy(org.ow2.cmi.lb.strategy.IStrategy<T> strategy)
setStrategy in interface org.ow2.cmi.lb.policy.IPolicy<T extends org.ow2.cmi.lb.LoadBalanceable>strategy - a strategy of load-balancingpublic org.ow2.cmi.lb.strategy.IStrategy<T> getStrategy()
getStrategy in interface org.ow2.cmi.lb.policy.IPolicy<T extends org.ow2.cmi.lb.LoadBalanceable>public void setClusterViewManager(org.ow2.cmi.controller.common.ClusterViewManager clusterViewManager)
clusterViewManager - the manager of the cluster view
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||