diff --git a/pom.xml b/pom.xml
index 3f8fd9aee7..0772f93c23 100644
--- a/pom.xml
+++ b/pom.xml
@@ -169,58 +169,6 @@
-
-
- default-profile
-
- true
-
- ${java.home}/../lib/jconsole.jar
-
-
-
- ${java.home}/../lib/tools.jar
- ${java.home}/../lib/jconsole.jar
-
-
-
-
- com.alibaba
- tools
- 1.6.0
- system
- ${toolsjar}
-
-
- com.alibaba
- jconsole
- 1.6.0
- system
- ${jconsolejar}
-
-
-
-
- mac-profile
-
- false
-
- ${java.home}/../Classes/jconsole.jar
-
-
-
-
- com.alibaba
- jconsole
- 1.6.0
- system
- ${java.home}/../Classes/jconsole.jar
-
-
-
-
-
-
javax.servlet
diff --git a/src/main/java/com/alibaba/druid/jconsole/ConnectionsPanel.java b/src/main/java/com/alibaba/druid/jconsole/ConnectionsPanel.java
deleted file mode 100644
index 2f579c6b7a..0000000000
--- a/src/main/java/com/alibaba/druid/jconsole/ConnectionsPanel.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package com.alibaba.druid.jconsole;
-
-import java.awt.BorderLayout;
-
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectInstance;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.TabularData;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-
-import com.alibaba.druid.logging.Log;
-import com.alibaba.druid.logging.LogFactory;
-
-public class ConnectionsPanel extends JPanel {
-
- private final static Log LOG = LogFactory.getLog(ConnectionsPanel.class);
-
- private static final long serialVersionUID = 1L;
-
- private MBeanServerConnection connection;
- private ObjectInstance objectInstance;
- private DataSourceInfo dataSourceInfo;
-
- private JTable table;
-
- private String[] columns = new String[] { "id", "connectTime", "connectTimespan",
- "establishTime", "aliveTimespan", "lastSql", "lastError", "lastErrorTime", "connectStatckTrace",
- "lastStatementStackTrace", "dataSource" };
-
- public ConnectionsPanel(MBeanServerConnection connection, ObjectInstance objectInstance,
- DataSourceInfo dataSourceInfo){
- super();
- this.connection = connection;
- this.objectInstance = objectInstance;
- this.dataSourceInfo = dataSourceInfo;
-
- try {
- TabularData connectionTabularData = (TabularData) connection.getAttribute(objectInstance.getObjectName(),
- "ConnectionList");
-
- Object[][] rows = new Object[connectionTabularData.size()][];
- int rowIndex = 0;
- for (Object item : connectionTabularData.values()) {
- CompositeData rowData = (CompositeData) item;
- Object[] row = new Object[columns.length];
- row[0] = rowData.get("id");
- row[1] = rowData.get("connectTime");
- row[2] = rowData.get("connectTimespan");
- row[3] = rowData.get("establishTime");
- row[4] = rowData.get("aliveTimespan");
-
- row[5] = rowData.get("lastSql");
- row[6] = rowData.get("lastError");
- row[7] = rowData.get("lastErrorTime");
- row[8] = rowData.get("connectStatckTrace");
- row[9] = rowData.get("lastStatementStackTrace");
-
- row[10] = rowData.get("dataSource");
-
- rows[rowIndex++] = row;
- }
-
- table = new JTable(rows, columns);
-
- JScrollPane tableScrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
- JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
-
- this.setLayout(new BorderLayout());
- this.add(tableScrollPane, BorderLayout.CENTER);
- } catch (Exception e) {
- LOG.error(e.getMessage(), e);
- }
- }
-
- public MBeanServerConnection getConnection() {
- return connection;
- }
-
- public ObjectInstance getObjectInstance() {
- return objectInstance;
- }
-
- public DataSourceInfo getDataSourceInfo() {
- return dataSourceInfo;
- }
-
-}
diff --git a/src/main/java/com/alibaba/druid/jconsole/DataSourceInfo.java b/src/main/java/com/alibaba/druid/jconsole/DataSourceInfo.java
deleted file mode 100644
index b05a9e0c50..0000000000
--- a/src/main/java/com/alibaba/druid/jconsole/DataSourceInfo.java
+++ /dev/null
@@ -1,134 +0,0 @@
-package com.alibaba.druid.jconsole;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import javax.management.MBeanServerConnection;
-import javax.management.openmbean.CompositeData;
-
-public class DataSourceInfo {
-
- private long id;
- private String name;
- private String url;
- private List filters = new ArrayList();
- private Date createdTime;
-
- private String rawDriverClassName;
- private String rawUrl;
- private int rawDriverMajorVersion;
- private int rawDriverMinorVersion;
- private String properties;
- private MBeanServerConnection connection;
-
- public DataSourceInfo(){
-
- }
-
- public DataSourceInfo(MBeanServerConnection conn, CompositeData data){
- this.connection = conn;
- this.id = ((Number) data.get("ID")).longValue();
- this.name = (String) data.get("Name");
- this.url = (String) data.get("URL");
- for (String item : (String[]) data.get("FilterClasses")) {
- filters.add(item);
- }
- this.createdTime = (Date) data.get("CreatedTime");
-
- this.rawDriverClassName = (String) data.get("RawDriverClassName");
- this.rawUrl = (String) data.get("RawUrl");
- this.rawDriverMajorVersion = ((Number) data.get("RawDriverMajorVersion")).intValue();
- this.rawDriverMinorVersion = ((Number) data.get("RawDriverMinorVersion")).intValue();
- this.properties = (String) data.get("Properties");
- }
-
- public MBeanServerConnection getConnection() {
- return connection;
- }
-
- public void setConnection(MBeanServerConnection connection) {
- this.connection = connection;
- }
-
- public long getId() {
- return id;
- }
-
- public void setId(long id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getUrl() {
- return url;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- public List getFilters() {
- return filters;
- }
-
- public void setFilters(List filters) {
- this.filters = filters;
- }
-
- public Date getCreatedTime() {
- return createdTime;
- }
-
- public void setCreatedTime(Date createdTime) {
- this.createdTime = createdTime;
- }
-
- public String getRawDriverClassName() {
- return rawDriverClassName;
- }
-
- public void setRawDriverClassName(String rawDriverClassName) {
- this.rawDriverClassName = rawDriverClassName;
- }
-
- public String getRawUrl() {
- return rawUrl;
- }
-
- public void setRawUrl(String rawUrl) {
- this.rawUrl = rawUrl;
- }
-
- public int getRawDriverMajorVersion() {
- return rawDriverMajorVersion;
- }
-
- public void setRawDriverMajorVersion(int rawDriverMajorVersion) {
- this.rawDriverMajorVersion = rawDriverMajorVersion;
- }
-
- public int getRawDriverMinorVersion() {
- return rawDriverMinorVersion;
- }
-
- public void setRawDriverMinorVersion(int rawDriverMinorVersion) {
- this.rawDriverMinorVersion = rawDriverMinorVersion;
- }
-
- public String getProperties() {
- return properties;
- }
-
- public void setProperties(String properties) {
- this.properties = properties;
- }
-
-}
diff --git a/src/main/java/com/alibaba/druid/jconsole/DataSourcePanel.java b/src/main/java/com/alibaba/druid/jconsole/DataSourcePanel.java
deleted file mode 100644
index 4de699fdc0..0000000000
--- a/src/main/java/com/alibaba/druid/jconsole/DataSourcePanel.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.alibaba.druid.jconsole;
-
-import java.awt.BorderLayout;
-import java.awt.Panel;
-
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-
-public class DataSourcePanel extends Panel {
-
- private static final long serialVersionUID = 1L;
-
- private DataSourceInfo dataSourceInfo;
-
- private JTable table;
-
- private String[] columns = new String[] { "Name", "Value" };
-
- public DataSourcePanel(DataSourceInfo dataSourceInfo){
- this.dataSourceInfo = dataSourceInfo;
-
- Object[][] rows = new Object[][] { { "ID", dataSourceInfo.getId() }, { "Name", dataSourceInfo.getName() },
- { "URL", dataSourceInfo.getUrl() }, { "Filters", dataSourceInfo.getFilters() },
- { "CreatedTime", dataSourceInfo.getCreatedTime() },
- { "RawDriverClassName", dataSourceInfo.getRawDriverClassName() },
- { "RawUrl", dataSourceInfo.getRawUrl() },
- { "RawDriverMajorVersion", dataSourceInfo.getRawDriverMajorVersion() },
- { "RawDriverMinorVersion", dataSourceInfo.getRawDriverMinorVersion() },
- { "Properties", dataSourceInfo.getProperties() }, };
- table = new JTable(rows, columns);
-
- JScrollPane tableScrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
- JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
-
- this.setLayout(new BorderLayout());
- this.add(tableScrollPane, BorderLayout.CENTER);
- }
-
- public DataSourceInfo getDataSourceInfo() {
- return dataSourceInfo;
- }
-
- public void setDataSourceInfo(DataSourceInfo dataSourceInfo) {
- this.dataSourceInfo = dataSourceInfo;
- }
-
-}
diff --git a/src/main/java/com/alibaba/druid/jconsole/DruidPanel.java b/src/main/java/com/alibaba/druid/jconsole/DruidPanel.java
deleted file mode 100644
index 202153cd6c..0000000000
--- a/src/main/java/com/alibaba/druid/jconsole/DruidPanel.java
+++ /dev/null
@@ -1,230 +0,0 @@
-package com.alibaba.druid.jconsole;
-
-import java.awt.BorderLayout;
-import java.awt.EventQueue;
-import java.lang.management.ManagementFactory;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import javax.management.MBeanInfo;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectInstance;
-import javax.management.ObjectName;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.TabularData;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-import javax.swing.BorderFactory;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JSplitPane;
-import javax.swing.JTree;
-import javax.swing.event.TreeSelectionEvent;
-import javax.swing.event.TreeSelectionListener;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.TreeSelectionModel;
-
-import com.alibaba.druid.logging.Log;
-import com.alibaba.druid.logging.LogFactory;
-import com.alibaba.druid.pool.DruidDataSource;
-import com.alibaba.druid.stat.JdbcStatManager;
-import com.sun.tools.jconsole.JConsoleContext;
-
-public class DruidPanel extends JPanel {
-
- private final static Log LOG = LogFactory.getLog(DruidPanel.class);
-
- private static final long serialVersionUID = 1L;
-
- protected JSplitPane mainSplit;
- protected JTree tree;
- protected JPanel sheet;
- protected DefaultMutableTreeNode rootNode;
- protected DefaultMutableTreeNode dataSourcesNode;
-
- public DruidPanel(){
- setLayout(new BorderLayout());
-
- mainSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
- mainSplit.setDividerLocation(160);
- mainSplit.setBorder(BorderFactory.createEmptyBorder());
-
- rootNode = new DefaultMutableTreeNode("root", true);
- dataSourcesNode = new DefaultMutableTreeNode(
- new NodeInfo(null, null, NodeType.DataSources, null, "DataSources"),
- true);
- rootNode.add(dataSourcesNode);
-
- tree = new JTree(rootNode);
- tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
- tree.setRootVisible(false);
-
- tree.addTreeSelectionListener(new TreeSelectionListener() {
-
- @Override
- public void valueChanged(TreeSelectionEvent e) {
- treeSelect(e);
- }
- });
-
- JScrollPane theScrollPane = new JScrollPane(tree, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
- JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
- JPanel treePanel = new JPanel(new BorderLayout());
- treePanel.add(theScrollPane, BorderLayout.CENTER);
- mainSplit.setLeftComponent(treePanel);
-
- sheet = new JPanel();
- mainSplit.setRightComponent(sheet);
-
- add(mainSplit);
-
- // init();
- }
-
- private void treeSelect(TreeSelectionEvent e) {
- DefaultMutableTreeNode node = (DefaultMutableTreeNode) e.getPath().getLastPathComponent();
-
- Object userObject = node.getUserObject();
- NodeInfo nodeInfo = (NodeInfo) userObject;
-
- if (nodeInfo == null) {
- mainSplit.setRightComponent(sheet);
- return;
- }
-
- if (nodeInfo.getType() == NodeType.DataSource) {
- DataSourceInfo dataSourceInfo = (DataSourceInfo) nodeInfo.getData();
- mainSplit.setRightComponent(new DataSourcePanel(dataSourceInfo));
- } else if (nodeInfo.getType() == NodeType.Connections) {
- DataSourceInfo dataSourceInfo = (DataSourceInfo) nodeInfo.getData();
- ConnectionsPanel connectionsPanel = new ConnectionsPanel(nodeInfo.getConnection(),
- nodeInfo.getObjectInstance(), dataSourceInfo);
- mainSplit.setRightComponent(connectionsPanel);
- } else if (nodeInfo.getType() == NodeType.SQL) {
- DataSourceInfo dataSourceInfo = (DataSourceInfo) nodeInfo.getData();
- SQLPanel connectionsPanel = new SQLPanel(nodeInfo.getConnection(), nodeInfo.getObjectInstance(),
- dataSourceInfo);
- mainSplit.setRightComponent(connectionsPanel);
- } else {
- mainSplit.setRightComponent(sheet);
- }
- }
-
- public void init() {
- try {
- ManagementFactory.getPlatformMBeanServer().registerMBean(JdbcStatManager.getInstance(),
- new ObjectName(
- "com.alibaba.druid:type=JdbcStatManager"));
-
- DruidDataSource dataSource = new DruidDataSource();
-
- ManagementFactory.getPlatformMBeanServer().registerMBean(dataSource,
- new ObjectName("com.alibaba.druid:type=DataSource"));
-
- dataSource.setUrl("jdbc:mock:");
- dataSource.setFilters("stat,trace");
-
- Connection conn = dataSource.getConnection();
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT 1");
- while (rs.next()) {
-
- }
- rs.close();
- stmt.close();
- conn.close();
- } catch (Exception ex) {
-
- }
- }
-
- protected Object doInBackground(JConsoleContext context) throws Exception {
- doInBackground(context.getMBeanServerConnection());
-
- return null;
- }
-
- protected void doInBackground(MBeanServerConnection conn) throws Exception {
- // dataSourcesNode.removeAllChildren();
-
- List stats = new ArrayList();
-
- Set instances = conn.queryMBeans(null, null);
- for (ObjectInstance instance : instances) {
- MBeanInfo info = conn.getMBeanInfo(instance.getObjectName());
- if ("com.alibaba.druid.stat.JdbcStatManager".equals(info.getClassName())) {
- stats.add(instance);
- continue;
- }
-
- }
-
- if (stats.size() == 0) {
-
- }
-
- for (ObjectInstance statInstance : stats) {
- TabularData tabularValue = (TabularData) conn.getAttribute(statInstance.getObjectName(), "DataSourceList");
- for (Object item : tabularValue.values()) {
- CompositeData rowData = (CompositeData) item;
-
- DataSourceInfo dataSourceInfo = new DataSourceInfo(conn, rowData);
-
- NodeInfo dataSourceNodeInfo = new NodeInfo(conn, statInstance, NodeType.DataSource, dataSourceInfo,
- dataSourceInfo.getName());
- DefaultMutableTreeNode dataSourceNode = new DefaultMutableTreeNode(dataSourceNodeInfo, true);
-
- NodeInfo connectionsNodeInfo = new NodeInfo(conn, statInstance, NodeType.Connections, dataSourceInfo,
- "Connections");
- DefaultMutableTreeNode connections = new DefaultMutableTreeNode(connectionsNodeInfo, true);
- {
- }
- dataSourceNode.add(connections);
-
- NodeInfo sqlNodeInfo = new NodeInfo(conn, statInstance, NodeType.SQL, dataSourceInfo, "SQL");
- DefaultMutableTreeNode sqlListNode = new DefaultMutableTreeNode(sqlNodeInfo, true);
- dataSourceNode.add(sqlListNode);
-
- dataSourcesNode.add(dataSourceNode);
- }
- }
-
- // TreePath path = new TreePath(dataSourcesNode.children());
- // tree.scrollPathToVisible(path);
- }
-
- public static void main(String[] args) throws Exception {
- EventQueue.invokeLater(new Runnable() {
-
- public void run() {
- try {
- JFrame frame = new JFrame();
-
- DruidPanel panel = new DruidPanel();
-
- frame.getContentPane().add(panel);
- frame.pack();
- frame.setSize(1024, 768);
-
- // final String urlPath = "/jndi/rmi://192.168.1.103:9005/jmxrmi";
- final String urlPath = "/jndi/rmi://10.20.138.25:9006/jmxrmi";
- JMXServiceURL jmxUrl = new JMXServiceURL("rmi", "", 0, urlPath);
-
- JMXConnector connector = JMXConnectorFactory.connect(jmxUrl);
- panel.doInBackground(connector.getMBeanServerConnection());
-
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setVisible(true);
- } catch (Exception e) {
- LOG.error(e.getMessage(), e);
- }
- }
- });
- }
-}
diff --git a/src/main/java/com/alibaba/druid/jconsole/DruidPlugin.java b/src/main/java/com/alibaba/druid/jconsole/DruidPlugin.java
deleted file mode 100644
index b64e5b6f67..0000000000
--- a/src/main/java/com/alibaba/druid/jconsole/DruidPlugin.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package com.alibaba.druid.jconsole;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.swing.JPanel;
-import javax.swing.SwingWorker;
-
-import com.sun.tools.jconsole.JConsolePlugin;
-
-public class DruidPlugin extends JConsolePlugin {
-
- private final Map tabs = new HashMap();
- private DruidPanel panel;
-
- public DruidPlugin(){
- panel = new DruidPanel();
- tabs.put("Druid", panel);
- }
-
- @Override
- public Map getTabs() {
- return tabs;
- }
-
- @Override
- public SwingWorker, ?> newSwingWorker() {
- SwingWorker, ?> worer = new SwingWorker