private static void testNonCompliant(Class<?> iface, boolean isMx) throws Exception {
try {
System.out.println("Creating a proxy for non-compliant " +
(isMx ? "MXBean" : "MBean") + " " +
iface.getName() + " ...");
MBeanServer mbs = MBeanServerFactory.newMBeanServer();
ObjectName on = new ObjectName("test:type=Proxy");
if (isMx) {
JMX.newMXBeanProxy(mbs, on, iface);
} else {
JMX.newMBeanProxy(mbs, on, iface);
}
fail("Created a proxy for non-compliant " +
(isMx ? "MXBean" : "MBean") + " - " + iface.getName());
} catch (Exception e) {
Throwable t = e;
while (t != null && !(t instanceof NotCompliantMBeanException)) {
t = t.getCause();
}
if (t != null) {
success("Proxy not created");
} else {
throw e;
}
}
}
JMXProxyTest.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:openjdk-jdk10
作者:
评论列表
文章目录