mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improve wall filter
This commit is contained in:
@@ -167,6 +167,22 @@ public class DruidDataSourceUtils {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public static Map<String, Object> getWallStatMap(Object druidDatasource) {
|
||||
if (druidDatasource.getClass() == DruidDataSource.class) {
|
||||
return ((DruidDataSource) druidDatasource).getWallStatMap();
|
||||
}
|
||||
|
||||
try {
|
||||
Method method = druidDatasource.getClass().getMethod("getWallStatMap");
|
||||
Object obj = method.invoke(druidDatasource);
|
||||
return (Map) obj;
|
||||
} catch (Exception e) {
|
||||
LOG.error("getWallStatMap error", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static List<Map<String, Object>> getPoolingConnectionInfo(Object druidDatasource) {
|
||||
if (druidDatasource.getClass() == DruidDataSource.class) {
|
||||
|
||||
Reference in New Issue
Block a user