// the load balancer should be already up and running from service
// cluster deployment
// get the cluster domain and host name from deployed Service
Service deployedLBService;
try {
deployedLBService = new DataInsertionAndRetrievalManager()
.getService(cartridgeInfo.getType());
} catch (PersistenceManagerException e) {
String errorMsg = "Error in checking if Service is available is PersistenceManager";
log.error(errorMsg, e);
throw new ADCException(errorMsg, e);
}
if (deployedLBService == null) {
String errorMsg = "There is no deployed Service for type "
+ cartridgeInfo.getType();
log.error(errorMsg);
throw new ADCException(errorMsg);
}
if(log.isDebugEnabled()){
log.debug(" Setting cluster Domain : " + deployedLBService.getClusterId());
log.debug(" Setting Host Name : " + deployedLBService.getHostName());
}
// set the cluster and hostname
cluster.setClusterDomain(deployedLBService.getClusterId());
cluster.setHostName(deployedLBService.getHostName());
return null;
} else {
// set cluster domain
cluster.setClusterDomain(generateClusterId(alias, cartridgeInfo.getType()));