|
||||||||||
| 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>
org.ow2.cmi.lb.policy.HASingleton<T>
T - The type of objects that was load-balanced@ThreadSafe public class HASingleton<T extends org.ow2.cmi.lb.LoadBalanceable>
Implementation of a policy of load-balancing that always favors one server in the cluster.
| Constructor Summary | |
|---|---|
HASingleton()
Construct a new instance of policy ha-singleton with the policy first available as rescue. |
|
| Method Summary | |
|---|---|
T |
choose(java.util.Collection<T> cmiReferences)
Always choose the same server (called singleton) on any client. |
java.lang.String |
getSingleton()
|
java.util.List<java.lang.String> |
getSingletons()
Return the order to elect a singleton in the cluster. |
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.cmi.lb.strategy.IStrategy<T> strategy)
Sets a strategy to modify the behavior of the rescue policy. |
java.lang.String |
toString()
|
| Methods inherited from class org.ow2.cmi.lb.policy.AbstractPolicy |
|---|
getStrategy, onChoose, onInvokeException, onLookupException, onReturn, setClusterViewManager |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HASingleton()
| Method Detail |
|---|
public T choose(java.util.Collection<T> cmiReferences)
throws org.ow2.cmi.lb.NoLoadBalanceableException
choose in interface org.ow2.cmi.lb.policy.IPolicy<T extends org.ow2.cmi.lb.LoadBalanceable>choose in class AbstractPolicy<T extends org.ow2.cmi.lb.LoadBalanceable>cmiReferences - a list of references
org.ow2.cmi.lb.NoLoadBalanceableException - if no server availablepublic 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>setStrategy in class AbstractPolicy<T extends org.ow2.cmi.lb.LoadBalanceable>strategy - a strategy of load-balancingpublic 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 | |||||||||