本文整理汇总了Java中javax.management.monitor.MonitorNotification类的典型用法代码示例。如果您正苦于以下问题:Java MonitorNotification类的具体用法?Java MonitorNotification怎么用?Java MonitorNotification使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MonitorNotification类属于javax.management.monitor包,在下文中一共展示了MonitorNotification类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleNotification
import javax.management.monitor.MonitorNotification; //导入依赖的package包/类
public void handleNotification(Notification notification, Object handback) {
echo(">>> Received notification: " + notification);
if (notification instanceof MonitorNotification) {
String type = notification.getType();
if (type.equals(MonitorNotification.RUNTIME_ERROR)) {
MonitorNotification mn = (MonitorNotification) notification;
echo("\tType: " + mn.getType());
echo("\tTimeStamp: " + mn.getTimeStamp());
echo("\tObservedObject: " + mn.getObservedObject());
echo("\tObservedAttribute: " + mn.getObservedAttribute());
echo("\tDerivedGauge: " + mn.getDerivedGauge());
echo("\tTrigger: " + mn.getTrigger());
synchronized (this) {
messageReceived = true;
notifyAll();
}
}
}
}
示例2: handleNotification
import javax.management.monitor.MonitorNotification; //导入依赖的package包/类
public void handleNotification(Notification n, Object hb) {
System.out.println("\tReceived notification: " + n.getType());
if (n instanceof MonitorNotification) {
MonitorNotification mn = (MonitorNotification) n;
System.out.println("\tSource: " +
mn.getSource());
System.out.println("\tType: " +
mn.getType());
System.out.println("\tTimeStamp: " +
mn.getTimeStamp());
System.out.println("\tObservedObject: " +
mn.getObservedObject());
System.out.println("\tObservedAttribute: " +
mn.getObservedAttribute());
System.out.println("\tDerivedGauge: " +
mn.getDerivedGauge());
System.out.println("\tTrigger: " +
mn.getTrigger());
}
}
示例3: handleNotification
import javax.management.monitor.MonitorNotification; //导入依赖的package包/类
public void handleNotification(Notification notification, Object handback) {
echo(">>> Received notification: " + notification);
if (notification instanceof MonitorNotification) {
String type = notification.getType();
if (type.equals(MonitorNotification.RUNTIME_ERROR)) {
MonitorNotification mn = (MonitorNotification) notification;
echo("\tType: " + mn.getType());
echo("\tTimeStamp: " + mn.getTimeStamp());
echo("\tObservedObject: " + mn.getObservedObject());
echo("\tObservedAttribute: " + mn.getObservedAttribute());
echo("\tDerivedGauge: " + mn.getDerivedGauge());
echo("\tTrigger: " + mn.getTrigger());
messageReceived = true;
}
}
}