/**
* @param lbconfig
*/
private void generateGroupMgtAgents(LoadBalancerConfiguration lbconfig) {
TenantLoadBalanceMembershipHandler handler =
ConfigHolder.getInstance()
.getTenantLoadBalanceMembershipHandler();
if (handler == null) {
String msg =
"TenantLoadBalanceMembershipHandler is null. Thus, We cannot proceed.";
log.error(msg);
throw new SynapseException(msg);
}
Map<String, HostContext> hostContexts = lbconfig.getHostContextMap();
// Add the Axis2 GroupManagement agents
if (hostContexts != null) {
// iterate through each host context
for (HostContext hostCtxt : hostContexts.values()) {
// each host can has multiple Tenant Contexts, iterate through them
for (TenantDomainContext tenantCtxt : hostCtxt
.getTenantDomainContexts()) {
String domain = tenantCtxt.getDomain();
String subDomain = tenantCtxt.getSubDomain();
// creates the group management agent
GroupMgtAgentBuilder.createGroupMgtAgent(domain,
subDomain);
}
// add to the handler
handler.addHostContext(hostCtxt);
}
}
}