// ע��ȫ�����ü���
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(),
runTimeConf.getUserName()));
diamondDbPasswdManager.init();
dbPasswdManager = diamondDbPasswdManager;
// ��ȡ����
String passwd = dbPasswdManager.getPasswd();
registerPasswdConfListener(diamondDbPasswdManager);
if (TStringUtil.isBlank(passwd)) {
String errorMsg = "[PasswdError] read passwd is Empty !";
logger.error(errorMsg);
throw new AtomInitialException(errorMsg);
}
runTimeConf.setPasswd(passwd);
}
// 8.ת��tAtomDsConfDO
LocalTxDataSourceDO localTxDataSourceDO = convertTAtomDsConf2JbossConf(
this.runTimeConf,
TAtomConstants.getDbNameStr(this.appName, this.dbKey));
// 9.������������������ȷֱ���׳��쳣
if (!checkLocalTxDataSourceDO(localTxDataSourceDO)) {
String errorMsg = "[ConfigError]init dataSource Prams Error! config is : "
+ localTxDataSourceDO.toString();
logger.error(errorMsg);
throw new AtomInitialException(errorMsg);
}
// 10.��������Դ
// �ر�TB-DATASOURCE��JMXע��
localTxDataSourceDO.setUseJmx(false);
LocalTxDataSource localTxDataSource = TaobaoDataSourceFactory