Browse Source

REPORT-9508 jboss启动报错

release/9.0
ju 6 years ago
parent
commit
5ad2f258d6
  1. 2
      fine-druid/src/com/fr/third/alibaba/druid/stat/DruidStatManagerFacade.java
  2. 19
      fine-druid/src/com/fr/third/alibaba/druid/stat/DruidStatService.java
  3. 43
      fine-druid/src/com/fr/third/alibaba/druid/support/monitor/dao/MonitorDaoJdbcImpl.java

2
fine-druid/src/com/fr/third/alibaba/druid/stat/DruidStatManagerFacade.java

@ -32,7 +32,6 @@ import com.fr.third.alibaba.druid.VERSION;
import com.fr.third.alibaba.druid.pool.DruidDataSource; import com.fr.third.alibaba.druid.pool.DruidDataSource;
import com.fr.third.alibaba.druid.sql.visitor.SQLEvalVisitorUtils; import com.fr.third.alibaba.druid.sql.visitor.SQLEvalVisitorUtils;
import com.fr.third.alibaba.druid.support.http.stat.WebAppStatManager; import com.fr.third.alibaba.druid.support.http.stat.WebAppStatManager;
import com.fr.third.alibaba.druid.support.spring.stat.SpringStatManager;
import com.fr.third.alibaba.druid.util.DruidDataSourceUtils; import com.fr.third.alibaba.druid.util.DruidDataSourceUtils;
import com.fr.third.alibaba.druid.util.JdbcSqlStatUtils; import com.fr.third.alibaba.druid.util.JdbcSqlStatUtils;
import com.fr.third.alibaba.druid.util.StringUtils; import com.fr.third.alibaba.druid.util.StringUtils;
@ -87,7 +86,6 @@ public final class DruidStatManagerFacade {
return; return;
} }
SpringStatManager.getInstance().resetStat();
WebAppStatManager.getInstance().resetStat(); WebAppStatManager.getInstance().resetStat();
resetSqlStat(); resetSqlStat();
resetDataSourceStat(); resetDataSourceStat();

19
fine-druid/src/com/fr/third/alibaba/druid/stat/DruidStatService.java

@ -35,7 +35,6 @@ import com.fr.third.alibaba.druid.support.http.stat.WebAppStatManager;
import com.fr.third.alibaba.druid.support.json.JSONUtils; import com.fr.third.alibaba.druid.support.json.JSONUtils;
import com.fr.third.alibaba.druid.support.logging.Log; import com.fr.third.alibaba.druid.support.logging.Log;
import com.fr.third.alibaba.druid.support.logging.LogFactory; import com.fr.third.alibaba.druid.support.logging.LogFactory;
import com.fr.third.alibaba.druid.support.spring.stat.SpringStatManager;
import com.fr.third.alibaba.druid.util.MapComparator; import com.fr.third.alibaba.druid.util.MapComparator;
import com.fr.third.alibaba.druid.util.StringUtils; import com.fr.third.alibaba.druid.util.StringUtils;
@ -166,24 +165,9 @@ public final class DruidStatService implements DruidStatServiceMBean {
return returnJSONResult(RESULT_CODE_SUCCESS, getWebSessionStatData(id)); return returnJSONResult(RESULT_CODE_SUCCESS, getWebSessionStatData(id));
} }
if (url.startsWith("/spring.json")) {
return returnJSONResult(RESULT_CODE_SUCCESS, getSpringStatDataList(parameters));
}
if (url.startsWith("/spring-detail.json")) {
String clazz = parameters.get("class");
String method = parameters.get("method");
return returnJSONResult(RESULT_CODE_SUCCESS, getSpringMethodStatData(clazz, method));
}
return returnJSONResult(RESULT_CODE_ERROR, "Do not support this request, please contact with administrator."); return returnJSONResult(RESULT_CODE_ERROR, "Do not support this request, please contact with administrator.");
} }
private List<Map<String, Object>> getSpringStatDataList(Map<String, String> parameters) {
List<Map<String, Object>> array = SpringStatManager.getInstance().getMethodStatData();
return comparatorOrderBy(array, parameters);
}
private List<Map<String, Object>> getWebURIStatDataList(Map<String, String> parameters) { private List<Map<String, Object>> getWebURIStatDataList(Map<String, String> parameters) {
List<Map<String, Object>> array = WebAppStatManager.getInstance().getURIStatData(); List<Map<String, Object>> array = WebAppStatManager.getInstance().getURIStatData();
return comparatorOrderBy(array, parameters); return comparatorOrderBy(array, parameters);
@ -197,9 +181,6 @@ public final class DruidStatService implements DruidStatServiceMBean {
return WebAppStatManager.getInstance().getSessionStat(sessionId); return WebAppStatManager.getInstance().getSessionStat(sessionId);
} }
private Map<String, Object> getSpringMethodStatData(String clazz, String method) {
return SpringStatManager.getInstance().getMethodStatData(clazz, method);
}
private List<Map<String, Object>> getWebSessionStatDataList(Map<String, String> parameters) { private List<Map<String, Object>> getWebSessionStatDataList(Map<String, String> parameters) {
List<Map<String, Object>> array = WebAppStatManager.getInstance().getSessionStatData(); List<Map<String, Object>> array = WebAppStatManager.getInstance().getSessionStatData();

43
fine-druid/src/com/fr/third/alibaba/druid/support/monitor/dao/MonitorDaoJdbcImpl.java

@ -15,24 +15,6 @@
*/ */
package com.fr.third.alibaba.druid.support.monitor.dao; package com.fr.third.alibaba.druid.support.monitor.dao;
import java.lang.reflect.Field;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.sql.Types;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import javax.sql.DataSource;
import com.fr.third.alibaba.druid.DruidRuntimeException; import com.fr.third.alibaba.druid.DruidRuntimeException;
import com.fr.third.alibaba.druid.pool.DruidDataSourceStatValue; import com.fr.third.alibaba.druid.pool.DruidDataSourceStatValue;
import com.fr.third.alibaba.druid.stat.JdbcSqlStatValue; import com.fr.third.alibaba.druid.stat.JdbcSqlStatValue;
@ -47,7 +29,6 @@ import com.fr.third.alibaba.druid.support.monitor.annotation.MTable;
import com.fr.third.alibaba.druid.support.monitor.entity.MonitorApp; import com.fr.third.alibaba.druid.support.monitor.entity.MonitorApp;
import com.fr.third.alibaba.druid.support.monitor.entity.MonitorCluster; import com.fr.third.alibaba.druid.support.monitor.entity.MonitorCluster;
import com.fr.third.alibaba.druid.support.monitor.entity.MonitorInstance; import com.fr.third.alibaba.druid.support.monitor.entity.MonitorInstance;
import com.fr.third.alibaba.druid.support.spring.stat.SpringMethodStatValue;
import com.fr.third.alibaba.druid.util.JdbcUtils; import com.fr.third.alibaba.druid.util.JdbcUtils;
import com.fr.third.alibaba.druid.util.StringUtils; import com.fr.third.alibaba.druid.util.StringUtils;
import com.fr.third.alibaba.druid.util.Utils; import com.fr.third.alibaba.druid.util.Utils;
@ -56,6 +37,23 @@ import com.fr.third.alibaba.druid.wall.WallProviderStatValue;
import com.fr.third.alibaba.druid.wall.WallSqlStatValue; import com.fr.third.alibaba.druid.wall.WallSqlStatValue;
import com.fr.third.alibaba.druid.wall.WallTableStatValue; import com.fr.third.alibaba.druid.wall.WallTableStatValue;
import javax.sql.DataSource;
import java.lang.reflect.Field;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.sql.Types;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
public class MonitorDaoJdbcImpl implements MonitorDao { public class MonitorDaoJdbcImpl implements MonitorDao {
private final static Log LOG = LogFactory.getLog(MonitorDaoJdbcImpl.class); private final static Log LOG = LogFactory.getLog(MonitorDaoJdbcImpl.class);
@ -66,8 +64,6 @@ public class MonitorDaoJdbcImpl implements MonitorDao {
DruidDataSourceStatValue.class); DruidDataSourceStatValue.class);
private BeanInfo sqlStatBeanInfo = new BeanInfo( private BeanInfo sqlStatBeanInfo = new BeanInfo(
JdbcSqlStatValue.class); JdbcSqlStatValue.class);
private BeanInfo springMethodStatBeanInfo = new BeanInfo(
SpringMethodStatValue.class);
private BeanInfo webURIStatBeanInfo = new BeanInfo( private BeanInfo webURIStatBeanInfo = new BeanInfo(
WebURIStatValue.class); WebURIStatValue.class);
private BeanInfo webAppStatBeanInfo = new BeanInfo( private BeanInfo webAppStatBeanInfo = new BeanInfo(
@ -128,11 +124,6 @@ public class MonitorDaoJdbcImpl implements MonitorDao {
} }
} }
@Override
public void saveSpringMethod(MonitorContext ctx, List<SpringMethodStatValue> list) {
save(springMethodStatBeanInfo, ctx, list);
}
@Override @Override
public void saveWebURI(MonitorContext ctx, List<WebURIStatValue> list) { public void saveWebURI(MonitorContext ctx, List<WebURIStatValue> list) {
save(webURIStatBeanInfo, ctx, list); save(webURIStatBeanInfo, ctx, list);

Loading…
Cancel
Save