isFirstServer = isServer;
} else {
//Mix of standalone instances and clusters is not allowed
if (isFirstServer^isServer) {
String msg = LbLogUtil.getStringManager().getString("MixofServerAndClusterNotSupported");
throw new LbReaderException(msg);
}
}
if (isServer) {
Server server = _domain.getServerNamed(name);
//An instance within cluster is not allowed
if(server.getCluster() != null){
String msg = LbLogUtil.getStringManager().getString("ServerPartofClusterNotSupported", name);
throw new LbReaderException(msg);
}
cls[i++] = new StandAloneClusterReaderImpl(_domain, _appRegistry, server);
} else {
Cluster cluster = _domain.getClusterNamed(name);
if(cluster == null){
String msg = LbLogUtil.getStringManager().getString("ClusterorInstanceNotFound", name);
throw new LbReaderException(msg);
}
cls[i++] = new ClusterReaderImpl(_domain, _appRegistry, cluster);
}
}
return cls;