private static boolean
mustBeConnectionNotification(Notification notif,
String requiredConnId,
String requiredType) {
if (!(notif instanceof JMXConnectionNotification)) {
System.out.println("Should have been a " +
"JMXConnectionNotification: " +
notif.getClass());
return false;
}
JMXConnectionNotification cnotif = (JMXConnectionNotification) notif;
if (!cnotif.getType().equals(requiredType)) {
System.out.println("Wrong type notif: is \"" + cnotif.getType() +
"\", should be \"" + requiredType + "\"");
return false;
}
if (!cnotif.getConnectionId().equals(requiredConnId)) {
System.out.println("Wrong connection id: is \"" +
cnotif.getConnectionId() + "\", should be \"" +
requiredConnId);
return false;
}
return true;
}
ConnectionTest.java 文件源码
java
阅读 34
收藏 0
点赞 0
评论 0
项目:jdk8u-jdk
作者:
评论列表
文章目录