String msg = _strMgr.getString("NotCluster", target);
throw new MBeanException( new ConfigException(msg));
}
}
Cluster c = null;
Server s = null;
if (ClusterHelper.isACluster(ctx, target)) {
c = ClusterHelper.getClusterByName(ctx, target);
if (c == null ) {
String msg = _strMgr.getString("ClusterNotDefined", target);
throw new MBeanException( new ConfigException(msg));
}
}else{
s = ServerHelper.getServerByName(ctx, target);
if (s == null ) {
String msg = _strMgr.getString("ServerNotDefined", target);
throw new MBeanException( new ConfigException(msg));
}
}
createLBRef(target,configName);
if(hcURL != null ){
try{
createHealthChecker(hcURL, hcInterval, hcTimeout, configName, target);
}catch(MBeanException e){
String msg = _strMgr.getString("HealthCheckerExists",target);
_logger.log(Level.WARNING, msg);
}
}
if(enableInstances) {
enableServer(target);
}
if(enableApps || lbPolicy != null || lbPolicyModule != null ) {
ApplicationRef[] appRefs = null;
LbConfig lbConfig = getLbConfig(configName);
if (ClusterHelper.isACluster(ctx, target)) {
appRefs = c.getApplicationRef();
}else{
appRefs = s.getApplicationRef();
}
if (appRefs != null && enableApps ) {
for(ApplicationRef ref:appRefs) {
//enable only user applications
if(!ApplicationHelper.isSystemApp(ctx, ref.getRef()))