当前位置: 首页>>代码示例>>Java>>正文


Java MonitorNotification类代码示例

本文整理汇总了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();
            }
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:21,代码来源:RuntimeExceptionTest.java

示例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());
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:21,代码来源:CounterMonitorInitThresholdTest.java

示例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;
        }
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:17,代码来源:RuntimeExceptionTest.java


注:本文中的javax.management.monitor.MonitorNotification类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。