}
}
}
public ServiceDO getService(int serverID, String serviceName) throws BAMException {
ServiceDO cashService = BAMConfigurationCache.getService(serverID, serviceName);
ServiceDO service = null;
BAMConfigurationDSClient configurationDSClient = null;
try {
if (cashService == null) {
configurationDSClient = BAMUtil.getBAMConfigurationDSClient();
// load service from DB
service = configurationDSClient.getService(serverID, serviceName);
if (service == null) {
// service not there in the DB, hence we need to add it
service = new ServiceDO();
service.setName(serviceName);
service.setServerID(serverID);
// This is to guard against occasional race condition of service
// being added while operation is also being added.
boolean raceCondition = false;
try {
configurationDSClient.addService(service);