mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
jconsole
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@234 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package com.alibaba.druid.jconsole;
|
||||
|
||||
import javax.management.MBeanServerConnection;
|
||||
import javax.management.ObjectName;
|
||||
import javax.management.ObjectInstance;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class ConnectionsPanel extends JPanel {
|
||||
@@ -9,20 +9,26 @@ public class ConnectionsPanel extends JPanel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private MBeanServerConnection connection;
|
||||
private ObjectName objectName;
|
||||
private ObjectInstance objectInstance;
|
||||
private DataSourceInfo dataSourceInfo;
|
||||
|
||||
public ConnectionsPanel(MBeanServerConnection connection, ObjectName objectName){
|
||||
public ConnectionsPanel(MBeanServerConnection connection, ObjectInstance objectInstance, DataSourceInfo dataSourceInfo){
|
||||
super();
|
||||
this.connection = connection;
|
||||
this.objectName = objectName;
|
||||
this.objectInstance = objectInstance;
|
||||
this.dataSourceInfo = dataSourceInfo;
|
||||
}
|
||||
|
||||
public MBeanServerConnection getConnection() {
|
||||
return connection;
|
||||
}
|
||||
|
||||
public ObjectName getObjectName() {
|
||||
return objectName;
|
||||
public ObjectInstance getObjectInstance() {
|
||||
return objectInstance;
|
||||
}
|
||||
|
||||
public DataSourceInfo getDataSourceInfo() {
|
||||
return dataSourceInfo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -94,6 +94,10 @@ public class DruidPanel extends JPanel {
|
||||
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 {
|
||||
mainSplit.setRightComponent(sheet);
|
||||
}
|
||||
@@ -159,13 +163,13 @@ public class DruidPanel extends JPanel {
|
||||
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, "Connections", "Connections");
|
||||
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.getName(), "SQL");
|
||||
NodeInfo sqlNodeInfo = new NodeInfo(conn, statInstance, NodeType.SQL, dataSourceInfo, "SQL");
|
||||
DefaultMutableTreeNode sqlListNode = new DefaultMutableTreeNode(sqlNodeInfo, true);
|
||||
dataSourceNode.add(sqlListNode);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user