javax.management.monitor.MonitorNotification Java Examples

The following examples show how to use javax.management.monitor.MonitorNotification. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CounterMonitorThresholdTest.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example #2
Source File: RuntimeExceptionTest.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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();
            }
        }
    }
}
 
Example #3
Source File: CounterMonitorThresholdTest.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example #4
Source File: ReflectionExceptionTest.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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();
            }
        }
    }
}
 
Example #5
Source File: CounterMonitorInitThresholdTest.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example #6
Source File: ReflectionExceptionTest.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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();
            }
        }
    }
}
 
Example #7
Source File: CounterMonitorThresholdTest.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example #8
Source File: ReflectionExceptionTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
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();
            }
        }
    }
}
 
Example #9
Source File: CounterMonitorInitThresholdTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example #10
Source File: RuntimeExceptionTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
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();
            }
        }
    }
}
 
Example #11
Source File: RuntimeExceptionTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
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();
            }
        }
    }
}
 
Example #12
Source File: CounterMonitorInitThresholdTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example #13
Source File: ReflectionExceptionTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
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();
            }
        }
    }
}
 
Example #14
Source File: CounterMonitorThresholdTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example #15
Source File: RuntimeExceptionTest.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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();
            }
        }
    }
}
 
Example #16
Source File: CounterMonitorThresholdTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example #17
Source File: CounterMonitorInitThresholdTest.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example #18
Source File: ReflectionExceptionTest.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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();
            }
        }
    }
}
 
Example #19
Source File: CounterMonitorThresholdTest.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example #20
Source File: RuntimeExceptionTest.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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;
        }
    }
}
 
Example #21
Source File: ReflectionExceptionTest.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
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();
            }
        }
    }
}
 
Example #22
Source File: CounterMonitorInitThresholdTest.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example #23
Source File: ReflectionExceptionTest.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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;
        }
    }
}
 
Example #24
Source File: CounterMonitorThresholdTest.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example #25
Source File: RuntimeExceptionTest.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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;
        }
    }
}
 
Example #26
Source File: CounterMonitorInitThresholdTest.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example #27
Source File: CounterMonitorInitThresholdTest.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example #28
Source File: ReflectionExceptionTest.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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;
        }
    }
}
 
Example #29
Source File: CounterMonitorThresholdTest.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example #30
Source File: RuntimeExceptionTest.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
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();
            }
        }
    }
}