|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.carol.cmi.lb.policy.HASingletonPolicy
@ThreadSafe public class HASingletonPolicy
Implementation of a policy of load-balancing that always favors one server in the cluster.
| Constructor Summary | |
|---|---|
HASingletonPolicy()
Construct a new instance of policy ha-singleton with the policy first available as rescue. |
|
| Method Summary | ||
|---|---|---|
org.ow2.carol.cmi.reference.CMIReference |
choose(java.util.List<org.ow2.carol.cmi.reference.CMIReference> cmiReferences)
Always choose the same server (called singleton) on any client. |
|
java.lang.String |
getPolicyClassname()
|
|
java.lang.String |
getSingleton()
|
|
java.util.List<java.lang.String> |
getSingletons()
Return the order to elect a singleton in the cluster. |
|
org.ow2.carol.cmi.lb.strategy.ILBStrategy<org.ow2.carol.cmi.reference.CMIReference> |
getStrategy()
|
|
org.ow2.carol.cmi.lb.decision.DecisionManager<java.lang.Void> |
onInvokeException(java.lang.reflect.Method method,
java.lang.Object[] parameters,
org.ow2.carol.cmi.reference.CMIReference cmiReference,
java.lang.Throwable thr)
Returns a decision when an exception is thrown during an invocation for a given reference. |
|
org.ow2.carol.cmi.lb.decision.DecisionManager<java.lang.Void> |
onLookupException(org.ow2.carol.cmi.reference.CMIReference cmiReference,
java.lang.Throwable thr)
Returns a decision when an exception is thrown during an access to a registry for a given reference. |
|
|
onReturn(java.lang.reflect.Method method,
java.lang.Object[] parameters,
org.ow2.carol.cmi.reference.CMIReference cmiReference,
ReturnType retVal)
Returns a decision when the invocation of a remote method ends. |
|
void |
setPolicyClassname(java.lang.String lbPolicyClassname)
|
|
void |
setSingleton(java.lang.String serverRef)
Add a server in the list of singleton at the first position (it will be the new master). |
|
void |
setSingletons(java.util.List<java.lang.String> serverRefs)
Set the order to elect a singleton in the cluster. |
|
void |
setStrategy(org.ow2.carol.cmi.lb.strategy.ILBStrategy<org.ow2.carol.cmi.reference.CMIReference> 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 HASingletonPolicy()
| Method Detail |
|---|
public org.ow2.carol.cmi.reference.CMIReference choose(java.util.List<org.ow2.carol.cmi.reference.CMIReference> cmiReferences)
throws org.ow2.carol.cmi.lb.NoLoadBalanceableException
choose in interface org.ow2.carol.cmi.lb.policy.ILBPolicy<org.ow2.carol.cmi.reference.CMIReference>cmiReferences - a list of references
org.ow2.carol.cmi.lb.NoLoadBalanceableException - if no server available
public org.ow2.carol.cmi.lb.decision.DecisionManager<java.lang.Void> onInvokeException(java.lang.reflect.Method method,
java.lang.Object[] parameters,
org.ow2.carol.cmi.reference.CMIReference cmiReference,
java.lang.Throwable thr)
onInvokeException in interface org.ow2.carol.cmi.lb.policy.ILBPolicy<org.ow2.carol.cmi.reference.CMIReference>method - the method that was invokedparameters - the parameters of the methodcmiReference - the reference that has caused the exceptionthr - the exception that is thrown
public org.ow2.carol.cmi.lb.decision.DecisionManager<java.lang.Void> onLookupException(org.ow2.carol.cmi.reference.CMIReference cmiReference,
java.lang.Throwable thr)
onLookupException in interface org.ow2.carol.cmi.lb.policy.ILBPolicy<org.ow2.carol.cmi.reference.CMIReference>cmiReference - the reference that has caused the exceptionthr - the exception that is thrown
public <ReturnType> org.ow2.carol.cmi.lb.decision.DecisionManager<ReturnType> onReturn(java.lang.reflect.Method method,
java.lang.Object[] parameters,
org.ow2.carol.cmi.reference.CMIReference cmiReference,
ReturnType retVal)
onReturn in interface org.ow2.carol.cmi.lb.policy.ILBPolicy<org.ow2.carol.cmi.reference.CMIReference>ReturnType - the type of the returned valuemethod - the method that was invokedparameters - the parameters of the methodcmiReference - the reference used for the invocationretVal - the returned value
public void setStrategy(org.ow2.carol.cmi.lb.strategy.ILBStrategy<org.ow2.carol.cmi.reference.CMIReference> lbStrategy)
setStrategy in interface org.ow2.carol.cmi.lb.policy.ILBPolicy<org.ow2.carol.cmi.reference.CMIReference>lbStrategy - a strategy of load-balancingpublic org.ow2.carol.cmi.lb.strategy.ILBStrategy<org.ow2.carol.cmi.reference.CMIReference> getStrategy()
public void setPolicyClassname(java.lang.String lbPolicyClassname)
throws org.ow2.carol.cmi.lb.NoLoadBalanceableException
org.ow2.carol.cmi.lb.NoLoadBalanceableException
public java.lang.String getPolicyClassname()
throws org.ow2.carol.cmi.lb.NoLoadBalanceableException
org.ow2.carol.cmi.lb.NoLoadBalanceableExceptionpublic java.util.List<java.lang.String> getSingletons()
public void setSingletons(java.util.List<java.lang.String> serverRefs)
serverRefs - a list of reference on servers (e.g. {rmi://localhost:9000})public void setSingleton(java.lang.String serverRef)
serverRef - a reference on server (e.g. rmi://localhost:9000)public java.lang.String getSingleton()
public 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 | |||||||||