}
// 1.��ʼ���������
if (TStringUtil.isBlank(this.appName) || TStringUtil.isBlank(this.dbKey)) {
String errorMsg = "[attributeError] TAtomDatasource of appName Or dbKey is Empty !";
logger.error(errorMsg);
throw new AtomIllegalException(errorMsg);
}
// 2.����dbConfManager
DiamondDbConfManager defaultDbConfManager = new DiamondDbConfManager();
defaultDbConfManager.setGlobalConfigDataId(TAtomConstants
.getGlobalDataId(this.dbKey));
defaultDbConfManager.setAppConfigDataId(TAtomConstants.getAppDataId(
this.appName, this.dbKey));
// ��ʼ��dbConfManager
defaultDbConfManager.init();
dbConfManager = defaultDbConfManager;
// 3.��ȡȫ������
String globaConfStr = dbConfManager.getGlobalDbConf();
// ע��ȫ�����ü���
registerGlobaDbConfListener(defaultDbConfManager);
if (TStringUtil.isBlank(globaConfStr)) {
String errorMsg = "[ConfError] read globalConfig is Empty !";
logger.error(errorMsg);
throw new AtomInitialException(errorMsg);
}
// 4.��ȡӦ������
String appConfStr = dbConfManager.getAppDbDbConf();
// ע��Ӧ�����ü���
registerAppDbConfListener(defaultDbConfManager);
if (TStringUtil.isBlank(appConfStr)) {
String errorMsg = "[ConfError] read appConfig is Empty !";
logger.error(errorMsg);
throw new AtomInitialException(errorMsg);
}
lock.lock();
try {
// 5.��������string��TAtomDsConfDO
runTimeConf = TAtomConfParser.parserTAtomDsConfDO(globaConfStr,
appConfStr);
// 6.��������������
overConfByLocal(localConf, runTimeConf);
// 7.���û�����ñ������룬���ö������룬��ʼ��passwdManager
if (TStringUtil.isBlank(this.runTimeConf.getPasswd())) {
// ���dbKey�Ͷ�Ӧ��userName�Ƿ�Ϊ��
if (TStringUtil.isBlank(runTimeConf.getUserName())) {
String errorMsg = "[attributeError] TAtomDatasource of UserName is Empty !";
logger.error(errorMsg);
throw new AtomIllegalException(errorMsg);
}
DiamondDbPasswdManager diamondDbPasswdManager = new DiamondDbPasswdManager();
diamondDbPasswdManager.setPasswdConfDataId(TAtomConstants
.getPasswdDataId(runTimeConf.getDbName(),
runTimeConf.getDbType(),