Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
af4b6955
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
af4b6955
编写于
6月 10, 2008
作者:
L
lmalvent
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6711106: REGRESSION: Bad usage of SnapshotMBeanServerConnection in MBeans tab and JConsole plugins.
Reviewed-by: jfdenise
上级
9f4b0a82
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
35 addition
and
16 deletion
+35
-16
src/share/classes/sun/tools/jconsole/MBeansTab.java
src/share/classes/sun/tools/jconsole/MBeansTab.java
+5
-0
src/share/classes/sun/tools/jconsole/ProxyClient.java
src/share/classes/sun/tools/jconsole/ProxyClient.java
+10
-6
src/share/classes/sun/tools/jconsole/inspector/XMBean.java
src/share/classes/sun/tools/jconsole/inspector/XMBean.java
+7
-2
src/share/classes/sun/tools/jconsole/inspector/XMBeanAttributes.java
...lasses/sun/tools/jconsole/inspector/XMBeanAttributes.java
+13
-8
未找到文件。
src/share/classes/sun/tools/jconsole/MBeansTab.java
浏览文件 @
af4b6955
...
@@ -37,6 +37,7 @@ import javax.management.*;
...
@@ -37,6 +37,7 @@ import javax.management.*;
import
javax.swing.*
;
import
javax.swing.*
;
import
javax.swing.event.*
;
import
javax.swing.event.*
;
import
javax.swing.tree.*
;
import
javax.swing.tree.*
;
import
sun.tools.jconsole.ProxyClient.SnapshotMBeanServerConnection
;
import
sun.tools.jconsole.inspector.*
;
import
sun.tools.jconsole.inspector.*
;
import
com.sun.tools.jconsole.JConsoleContext
;
import
com.sun.tools.jconsole.JConsoleContext
;
...
@@ -154,6 +155,10 @@ public class MBeansTab extends Tab implements
...
@@ -154,6 +155,10 @@ public class MBeansTab extends Tab implements
return
vmPanel
.
getProxyClient
().
getMBeanServerConnection
();
return
vmPanel
.
getProxyClient
().
getMBeanServerConnection
();
}
}
public
SnapshotMBeanServerConnection
getSnapshotMBeanServerConnection
()
{
return
vmPanel
.
getProxyClient
().
getSnapshotMBeanServerConnection
();
}
@Override
@Override
public
void
update
()
{
public
void
update
()
{
// Ping the connection to see if it is still alive. At
// Ping the connection to see if it is still alive. At
...
...
src/share/classes/sun/tools/jconsole/ProxyClient.java
浏览文件 @
af4b6955
...
@@ -28,7 +28,6 @@ package sun.tools.jconsole;
...
@@ -28,7 +28,6 @@ package sun.tools.jconsole;
import
com.sun.management.HotSpotDiagnosticMXBean
;
import
com.sun.management.HotSpotDiagnosticMXBean
;
import
com.sun.tools.jconsole.JConsoleContext
;
import
com.sun.tools.jconsole.JConsoleContext
;
import
com.sun.tools.jconsole.JConsoleContext.ConnectionState
;
import
com.sun.tools.jconsole.JConsoleContext.ConnectionState
;
import
java.awt.Component
;
import
java.beans.PropertyChangeListener
;
import
java.beans.PropertyChangeListener
;
import
java.beans.PropertyChangeEvent
;
import
java.beans.PropertyChangeEvent
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -78,6 +77,7 @@ public class ProxyClient implements JConsoleContext {
...
@@ -78,6 +77,7 @@ public class ProxyClient implements JConsoleContext {
private
String
advancedUrl
=
null
;
private
String
advancedUrl
=
null
;
private
JMXServiceURL
jmxUrl
=
null
;
private
JMXServiceURL
jmxUrl
=
null
;
private
MBeanServerConnection
mbsc
=
null
;
private
SnapshotMBeanServerConnection
server
=
null
;
private
SnapshotMBeanServerConnection
server
=
null
;
private
JMXConnector
jmxc
=
null
;
private
JMXConnector
jmxc
=
null
;
private
RMIServer
stub
=
null
;
private
RMIServer
stub
=
null
;
...
@@ -103,7 +103,6 @@ public class ProxyClient implements JConsoleContext {
...
@@ -103,7 +103,6 @@ public class ProxyClient implements JConsoleContext {
private
List
<
MemoryPoolProxy
>
memoryPoolProxies
=
null
;
private
List
<
MemoryPoolProxy
>
memoryPoolProxies
=
null
;
private
List
<
GarbageCollectorMXBean
>
garbageCollectorMBeans
=
null
;
private
List
<
GarbageCollectorMXBean
>
garbageCollectorMBeans
=
null
;
private
String
detectDeadlocksOperation
=
null
;
final
static
private
String
HOTSPOT_DIAGNOSTIC_MXBEAN_NAME
=
final
static
private
String
HOTSPOT_DIAGNOSTIC_MXBEAN_NAME
=
"com.sun.management:type=HotSpotDiagnostic"
;
"com.sun.management:type=HotSpotDiagnostic"
;
...
@@ -326,8 +325,8 @@ public class ProxyClient implements JConsoleContext {
...
@@ -326,8 +325,8 @@ public class ProxyClient implements JConsoleContext {
if
(
jmxUrl
==
null
&&
"localhost"
.
equals
(
hostName
)
&&
port
==
0
)
{
if
(
jmxUrl
==
null
&&
"localhost"
.
equals
(
hostName
)
&&
port
==
0
)
{
// Monitor self
// Monitor self
this
.
jmxc
=
null
;
this
.
jmxc
=
null
;
this
.
server
=
Snapshot
.
newSnapshot
(
this
.
mbsc
=
ManagementFactory
.
getPlatformMBeanServer
();
ManagementFactory
.
getPlatformMBeanServer
()
);
this
.
server
=
Snapshot
.
newSnapshot
(
mbsc
);
}
else
{
}
else
{
// Monitor another process
// Monitor another process
if
(
lvm
!=
null
)
{
if
(
lvm
!=
null
)
{
...
@@ -369,7 +368,8 @@ public class ProxyClient implements JConsoleContext {
...
@@ -369,7 +368,8 @@ public class ProxyClient implements JConsoleContext {
this
.
jmxc
=
JMXConnectorFactory
.
connect
(
jmxUrl
,
env
);
this
.
jmxc
=
JMXConnectorFactory
.
connect
(
jmxUrl
,
env
);
}
}
}
}
this
.
server
=
Snapshot
.
newSnapshot
(
jmxc
.
getMBeanServerConnection
());
this
.
mbsc
=
jmxc
.
getMBeanServerConnection
();
this
.
server
=
Snapshot
.
newSnapshot
(
mbsc
);
}
}
this
.
isDead
=
false
;
this
.
isDead
=
false
;
...
@@ -518,7 +518,11 @@ public class ProxyClient implements JConsoleContext {
...
@@ -518,7 +518,11 @@ public class ProxyClient implements JConsoleContext {
}
}
}
}
public
MBeanServerConnection
getMBeanServerConnection
()
{
public
MBeanServerConnection
getMBeanServerConnection
()
{
return
mbsc
;
}
public
SnapshotMBeanServerConnection
getSnapshotMBeanServerConnection
()
{
return
server
;
return
server
;
}
}
...
...
src/share/classes/sun/tools/jconsole/inspector/XMBean.java
浏览文件 @
af4b6955
...
@@ -30,6 +30,7 @@ import javax.management.*;
...
@@ -30,6 +30,7 @@ import javax.management.*;
import
javax.swing.Icon
;
import
javax.swing.Icon
;
import
sun.tools.jconsole.JConsole
;
import
sun.tools.jconsole.JConsole
;
import
sun.tools.jconsole.MBeansTab
;
import
sun.tools.jconsole.MBeansTab
;
import
sun.tools.jconsole.ProxyClient.SnapshotMBeanServerConnection
;
public
class
XMBean
{
public
class
XMBean
{
...
@@ -60,6 +61,10 @@ public class XMBean {
...
@@ -60,6 +61,10 @@ public class XMBean {
return
mbeansTab
.
getMBeanServerConnection
();
return
mbeansTab
.
getMBeanServerConnection
();
}
}
SnapshotMBeanServerConnection
getSnapshotMBeanServerConnection
()
{
return
mbeansTab
.
getSnapshotMBeanServerConnection
();
}
public
Boolean
isBroadcaster
()
{
public
Boolean
isBroadcaster
()
{
synchronized
(
broadcasterLock
)
{
synchronized
(
broadcasterLock
)
{
if
(
broadcaster
==
null
)
{
if
(
broadcaster
==
null
)
{
...
@@ -103,14 +108,14 @@ public class XMBean {
...
@@ -103,14 +108,14 @@ public class XMBean {
public
Object
getAttribute
(
String
attributeName
)
public
Object
getAttribute
(
String
attributeName
)
throws
AttributeNotFoundException
,
InstanceNotFoundException
,
throws
AttributeNotFoundException
,
InstanceNotFoundException
,
MBeanException
,
ReflectionException
,
IOException
{
MBeanException
,
ReflectionException
,
IOException
{
return
getMBeanServerConnection
().
getAttribute
(
return
get
Snapshot
MBeanServerConnection
().
getAttribute
(
getObjectName
(),
attributeName
);
getObjectName
(),
attributeName
);
}
}
public
AttributeList
getAttributes
(
String
attributeNames
[])
public
AttributeList
getAttributes
(
String
attributeNames
[])
throws
AttributeNotFoundException
,
InstanceNotFoundException
,
throws
AttributeNotFoundException
,
InstanceNotFoundException
,
MBeanException
,
ReflectionException
,
IOException
{
MBeanException
,
ReflectionException
,
IOException
{
return
getMBeanServerConnection
().
getAttributes
(
return
get
Snapshot
MBeanServerConnection
().
getAttributes
(
getObjectName
(),
attributeNames
);
getObjectName
(),
attributeNames
);
}
}
...
...
src/share/classes/sun/tools/jconsole/inspector/XMBeanAttributes.java
浏览文件 @
af4b6955
...
@@ -349,7 +349,14 @@ public class XMBeanAttributes extends XTable {
...
@@ -349,7 +349,14 @@ public class XMBeanAttributes extends XTable {
try
{
try
{
list
=
mbean
.
getAttributes
(
attributesInfo
);
list
=
mbean
.
getAttributes
(
attributesInfo
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
if
(
JConsole
.
isDebug
())
{
System
.
err
.
println
(
"Error calling getAttributes() on MBean \""
+
mbean
.
getObjectName
()
+
"\". JConsole will "
+
"try to get them individually calling "
+
"getAttribute() instead. Exception:"
);
e
.
printStackTrace
(
System
.
err
);
}
list
=
new
AttributeList
();
list
=
new
AttributeList
();
//Can't load all attributes, do it one after each other.
//Can't load all attributes, do it one after each other.
for
(
int
i
=
0
;
i
<
attributesInfo
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
attributesInfo
.
length
;
i
++)
{
...
@@ -357,7 +364,7 @@ public class XMBeanAttributes extends XTable {
...
@@ -357,7 +364,7 @@ public class XMBeanAttributes extends XTable {
try
{
try
{
name
=
attributesInfo
[
i
].
getName
();
name
=
attributesInfo
[
i
].
getName
();
Object
value
=
Object
value
=
mbean
.
get
Attribute
(
name
);
mbean
.
get
MBeanServerConnection
().
getAttribute
(
mbean
.
getObjectName
(),
name
);
list
.
add
(
new
Attribute
(
name
,
value
));
list
.
add
(
new
Attribute
(
name
,
value
));
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
if
(
attributesInfo
[
i
].
isReadable
())
{
if
(
attributesInfo
[
i
].
isReadable
())
{
...
@@ -397,8 +404,8 @@ public class XMBeanAttributes extends XTable {
...
@@ -397,8 +404,8 @@ public class XMBeanAttributes extends XTable {
// went wrong.
// went wrong.
try
{
try
{
Object
v
=
Object
v
=
mbean
.
get
Attribute
(
attributeInfo
.
mbean
.
get
MBeanServerConnection
().
getAttribute
(
getName
());
mbean
.
getObjectName
(),
attributeInfo
.
getName
());
//What happens if now it is ok?
//What happens if now it is ok?
// Be pragmatic, add it to readable...
// Be pragmatic, add it to readable...
attributes
.
put
(
attributeInfo
.
getName
(),
attributes
.
put
(
attributeInfo
.
getName
(),
...
@@ -528,10 +535,8 @@ public class XMBeanAttributes extends XTable {
...
@@ -528,10 +535,8 @@ public class XMBeanAttributes extends XTable {
}
}
public
void
refreshAttributes
()
{
public
void
refreshAttributes
()
{
MBeanServerConnection
mbsc
=
mbeansTab
.
getMBeanServerConnection
();
SnapshotMBeanServerConnection
mbsc
=
mbeansTab
.
getSnapshotMBeanServerConnection
();
if
(
mbsc
instanceof
SnapshotMBeanServerConnection
)
{
mbsc
.
flush
();
((
SnapshotMBeanServerConnection
)
mbsc
).
flush
();
}
stopCellEditing
();
stopCellEditing
();
loadAttributes
(
mbean
,
mbeanInfo
);
loadAttributes
(
mbean
,
mbeanInfo
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录