Example usage for javax.management NotificationEmitter removeNotificationListener

List of usage examples for javax.management NotificationEmitter removeNotificationListener

Introduction

In this page you can find the example usage for javax.management NotificationEmitter removeNotificationListener.

Prototype

public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException;

Source Link

Document

Removes a listener from this MBean.

Usage

From source file:net.centro.rtb.monitoringcenter.metrics.system.jvm.GarbageCollectorMetricSet.java

public void shutdown() {
    if (gcLogTailer != null) {
        gcLogTailer.stop();/*from ww  w  .ja v a2 s.com*/
    }

    for (GarbageCollectorMXBean garbageCollectorMXBean : garbageCollectorMXBeans) {
        if (NotificationEmitter.class.isInstance(garbageCollectorMXBean)) {
            NotificationEmitter emitter = NotificationEmitter.class.cast(garbageCollectorMXBean);
            try {
                emitter.removeNotificationListener(gcEventListener);
            } catch (ListenerNotFoundException ignore) {
            }
        }
    }
}