Map<String, DataSourceWrapper> old = this.dataSourceWrapperMap;
this.dataSourceWrapperMap = newDataSourceWrapperMap;
old.clear();
old = null;
DBSelector r_DBSelector = null;
DBSelector w_DBSelector = null;
// ���ֻ��һ��db������OneDBSelector
if (dswList.size() == 1) {
DataSourceWrapper dsw2 = dswList.get(0);
r_DBSelector = new OneDBSelector(dsw2);
r_DBSelector.setDbType(dsw2.getDBType());
w_DBSelector = r_DBSelector;
} else {
// ��д���ȼ�Map
Map<Integer/* ���ȼ� */, List<DataSourceWrapper>/* ���ȼ�Ϊkey��DS �б� */> rPriority2DswList = new HashMap<Integer, List<DataSourceWrapper>>();
Map<Integer, List<DataSourceWrapper>> wPriority2DswList = new HashMap<Integer, List<DataSourceWrapper>>();
for (DataSourceWrapper dsw1 : dswList) {
add2LinkedListMap(rPriority2DswList, dsw1.getWeight().p, dsw1);
add2LinkedListMap(wPriority2DswList, dsw1.getWeight().q, dsw1);
}
r_DBSelector = createDBSelector(rPriority2DswList, true);
w_DBSelector = createDBSelector(wPriority2DswList, false);
}
r_DBSelector.setReadable(true);
w_DBSelector.setReadable(false);
this.readDBSelectorWrapper = r_DBSelector;
this.writeDBSelectorWrapper = w_DBSelector;
if (tGroupDataSource.getAutoSelectWriteDataSource())