use of org.apache.axis2.clustering.management.GroupManagementAgent in project wso2-synapse by wso2.
the class ServiceLoadBalanceMembershipHandler method getNextApplicationMember.
public Member getNextApplicationMember(String host) {
DomainAlgorithmContext domainAlgorithmContext = getDomainAlgorithmContext(host);
String lbDomain = domainAlgorithmContext.getDomain();
LoadbalanceAlgorithm algorithm = domainAlgorithmContext.getAlgorithm();
GroupManagementAgent groupMgtAgent = clusteringAgent.getGroupManagementAgent(lbDomain);
if (groupMgtAgent == null) {
String msg = "A LoadBalanceEventHandler has not been specified in the axis2.xml " + "file for the domain " + lbDomain + " for host " + host;
log.error(msg);
throw new SynapseException(msg);
}
algorithm.setApplicationMembers(groupMgtAgent.getMembers());
AlgorithmContext context = domainAlgorithmContext.getAlgorithmContext();
return algorithm.getNextApplicationMember(context);
}
Aggregations