mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add exection sorter test
This commit is contained in:
@@ -143,6 +143,16 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
String property = System.getProperty("druid.testWhileIdle");
|
||||
if ("true".equals(property)) {
|
||||
this.setTestWhileIdle(true);
|
||||
} else if ("false".equals(property)) {
|
||||
this.setTestWhileIdle(false);
|
||||
}
|
||||
}
|
||||
{
|
||||
String property = System.getProperty("druid.testOnBorrow");
|
||||
if ("true".equals(property)) {
|
||||
this.setTestOnBorrow(true);
|
||||
} else if ("false".equals(property)) {
|
||||
this.setTestOnBorrow(false);
|
||||
}
|
||||
}
|
||||
{
|
||||
@@ -159,6 +169,19 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
this.setUseGloalDataSourceStat(false);
|
||||
}
|
||||
}
|
||||
{
|
||||
String property = System.getProperty("druid.filters");
|
||||
|
||||
if (property == null || property.length() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
this.setFilters(property);
|
||||
} catch (SQLException e) {
|
||||
LOG.error("setFilters error", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isUseGloalDataSourceStat() {
|
||||
@@ -374,8 +397,6 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
|
||||
this.id = DruidDriver.createDataSourceId();
|
||||
|
||||
loadFilterFromSystemProperty();
|
||||
|
||||
if (this.dbType == null || this.dbType.length() == 0) {
|
||||
this.dbType = JdbcUtils.getDbType(jdbcUrl, null);
|
||||
}
|
||||
@@ -523,15 +544,6 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
createConnectionThread.start();
|
||||
}
|
||||
|
||||
private void loadFilterFromSystemProperty() throws SQLException {
|
||||
String property = System.getProperty("druid.filters");
|
||||
|
||||
if (property == null || property.length() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setFilters(property);
|
||||
}
|
||||
|
||||
/**
|
||||
* load filters from SPI ServiceLoader
|
||||
@@ -1284,15 +1296,6 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isBusy() {
|
||||
lock.lock();
|
||||
try {
|
||||
return this.inited && this.activeCount == maxActive && this.poolingCount == 0;
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public long getRemoveAbandonedCount() {
|
||||
return removeAbandonedCount;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user