本文整理汇总了Java中javax.management.MBeanInfo.getNotifications方法的典型用法代码示例。如果您正苦于以下问题:Java MBeanInfo.getNotifications方法的具体用法?Java MBeanInfo.getNotifications怎么用?Java MBeanInfo.getNotifications使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.management.MBeanInfo
的用法示例。
在下文中一共展示了MBeanInfo.getNotifications方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: printMBeanInfo
import javax.management.MBeanInfo; //导入方法依赖的package包/类
private void printMBeanInfo(MBeanInfo mbInfo) {
System.out.println("Description " + mbInfo.getDescription());
for (MBeanConstructorInfo ctor : mbInfo.getConstructors()) {
System.out.println("Constructor " + ctor.getName());
}
for (MBeanAttributeInfo att : mbInfo.getAttributes()) {
System.out.println("Attribute " + att.getName()
+ " [" + att.getType() + "]");
}
for (MBeanOperationInfo oper : mbInfo.getOperations()) {
System.out.println("Operation " + oper.getName());
}
for (MBeanNotificationInfo notif : mbInfo.getNotifications()) {
System.out.println("Notification " + notif.getName());
}
}
示例2: checkMBeanInfo
import javax.management.MBeanInfo; //导入方法依赖的package包/类
private int checkMBeanInfo(MBeanInfo mbi, Descriptor refDescr) {
MBeanNotificationInfo[] notifsInfo = mbi.getNotifications();
int res = 0;
for (MBeanNotificationInfo mbni : notifsInfo) {
if ( mbni.getDescriptor().equals(refDescr) ) {
System.out.println("(OK)");
} else {
System.out.println("(ERROR) Descriptor of the notification is "
+ mbni.getDescriptor()
+ " as we expect "
+ refDescr);
res++;
}
}
return res;
}