split the getter/setter for selector

Some old versions of Spring Framework would check the getter/setter of
a bean property. While they were not the same type, exception would be
thrown.
So selector’s getter&setter are all String now.
This commit is contained in:
DigitalSonic
2018-08-05 23:42:59 +08:00
parent 0d78a27d48
commit f355d62981
5 changed files with 31 additions and 12 deletions
@@ -145,12 +145,20 @@ public class HighAvailableDataSource extends WrapperAdapter implements DataSourc
}
DataSourceSelector selector = DataSourceSelectorFactory.getSelector(name, this);
if (selector != null) {
this.selector = selector;
setDataSourceSelector(selector);
}
}
public DataSourceSelector getSelector() {
return selector;
public String getSelector() {
return selector == null ? null : selector.getName();
}
public DataSourceSelector getDataSourceSelector() {
return this.selector;
}
public void setDataSourceSelector(DataSourceSelector dataSourceSelector) {
this.selector = dataSourceSelector;
}
@Override