Interface LoadbalanceAlgorithm
-
- All Superinterfaces:
Cloneable
- All Known Implementing Classes:
RoundRobin,WeightedRoundRobin,WeightedRRLCAlgorithm
public interface LoadbalanceAlgorithm extends Cloneable
All load balance algorithms must implement this interface. Implementations of this interface can be registered in LoadbalanceManagers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LoadbalanceAlgorithmclone()StringgetName()Return the name of the load balancing algorithmorg.apache.axis2.clustering.MembergetNextApplicationMember(AlgorithmContext algorithmContext)This method returns the next member to which the request has been sent to, according to the algorithm implementation.EndpointgetNextEndpoint(MessageContext synapseMessageContext, AlgorithmContext algorithmContext)This method returns the next node according to the algorithm implementation.voidreset(AlgorithmContext algorithmContext)Resets the algorithm to its initial position.voidsetApplicationMembers(List<org.apache.axis2.clustering.Member> members)Set the application membersvoidsetEndpoints(List<Endpoint> endpoints)Set the endpointsvoidsetLoadBalanceEndpoint(Endpoint endpoint)Set the loadbalance endpoint
-
-
-
Method Detail
-
setApplicationMembers
void setApplicationMembers(List<org.apache.axis2.clustering.Member> members)
Set the application members- Parameters:
members- The application members
-
setEndpoints
void setEndpoints(List<Endpoint> endpoints)
Set the endpoints- Parameters:
endpoints- The endpoints
-
setLoadBalanceEndpoint
void setLoadBalanceEndpoint(Endpoint endpoint)
Set the loadbalance endpoint- Parameters:
endpoint- the endpoint which uses this algorithm
-
getNextEndpoint
Endpoint getNextEndpoint(MessageContext synapseMessageContext, AlgorithmContext algorithmContext)
This method returns the next node according to the algorithm implementation.- Parameters:
synapseMessageContext- SynapseMessageContext of the current messagealgorithmContext- The context in which holds run time states related to the algorithm- Returns:
- Next node for directing the message
-
getNextApplicationMember
org.apache.axis2.clustering.Member getNextApplicationMember(AlgorithmContext algorithmContext)
This method returns the next member to which the request has been sent to, according to the algorithm implementation.- Parameters:
algorithmContext- The context in which holds run time states related to the algorithm- Returns:
- Next application member to which the request has to be sent to
-
reset
void reset(AlgorithmContext algorithmContext)
Resets the algorithm to its initial position. Initial position depends on the implementation.- Parameters:
algorithmContext- The context in which holds run time states related to the algorithm
-
getName
String getName()
Return the name of the load balancing algorithm- Returns:
- the name of the algorithm implemented
-
clone
LoadbalanceAlgorithm clone()
-
-