public void close() { if(notificationListener != null) { MemoryMXBean mxBean = ManagementFactory.getMemoryMXBean(); NotificationEmitter emitter = (NotificationEmitter) mxBean; try { emitter.removeNotificationListener(notificationListener); } catch(ListenerNotFoundException e) { LOG.warn("Failed to remove HeapMemoryMonitor notification listener from MemoryMXBean", e); } } } }
emitter.removeNotificationListener(this, null, null); if (logger.isDebugEnabled()) { logger.debug("Removed Memory MXBean notification listener" + this);
NotificationEmitter emitter = (NotificationEmitter) memoryMBean; try { emitter.removeNotificationListener(memoryListener); } catch (ListenerNotFoundException lnfe) {}
@Override public void close() throws IOException { if (emitter != null && listener != null) { try { emitter.removeNotificationListener(listener); } catch (ListenerNotFoundException e) { // } } }
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException { notificationEmitter.removeNotificationListener(listener, filter, handback); }
public void removeNotificationListener(MBeanMetaData metadata, NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException { ((NotificationEmitter)metadata.mbean).removeNotificationListener(listener, filter, handback); }
public void removeNotificationListener( NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException { ((NotificationEmitter)handler).removeNotificationListener( listener, filter, handback ); }
@Override public void removeNotificationListener(final NotificationListener listener, final NotificationFilter filter, final Object handback) throws ListenerNotFoundException { if (_emitter != null) { _emitter.removeNotificationListener(listener, filter, handback); } }
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object obj) throws javax.management.ListenerNotFoundException { mNotify.removeNotificationListener(listener, filter, obj); } }
@Override public void removeNotificationListener(final NotificationListener listener) throws ListenerNotFoundException { if (_emitter != null) { _emitter.removeNotificationListener(listener); } }
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException { notificationEmitter.removeNotificationListener(listener); }
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException { emitter.removeNotificationListener(listener); }
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException { emitter.removeNotificationListener(listener, filter, handback); }
public void removeNotificationListener( NotificationListener listener ) throws ListenerNotFoundException { ((NotificationEmitter)handler).removeNotificationListener( listener ); }
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException { emitter.removeNotificationListener(listener); }
private void unregisterBeanListener() { for (GarbageCollectorMXBean gcBean : ManagementFactory.getGarbageCollectorMXBeans()) { if (gcBean instanceof NotificationEmitter) { try { ((NotificationEmitter) gcBean).removeNotificationListener(this); } catch (ListenerNotFoundException e) { log.debug("No listener found on bean {}, should have been there.", gcBean, e); } } } }
public void unsubscribe() { for (GarbageCollectorMXBean bean : ManagementFactory.getGarbageCollectorMXBeans()) { NotificationEmitter emitter = (NotificationEmitter) bean; try { emitter.removeNotificationListener(listener); } catch (ListenerNotFoundException e) { LOGGER.debug("Error during unsuscribing GC listener", e); } } } }
@Override public void destroy() { memoryMXBean = ManagementFactory.getMemoryMXBean(); NotificationEmitter emitter = (NotificationEmitter)memoryMXBean; List<MemoryPoolMXBean> memPools = ManagementFactory.getMemoryPoolMXBeans(); for (MemoryPoolMXBean memoryPoolMXBean : memPools) { try { emitter.removeNotificationListener(this, null, memoryPoolMXBean); } catch (Exception e) { } } }
@Override public void close() { for (NotificationEmitter e : this.emitters) { try { e.removeNotificationListener(this); } catch (ListenerNotFoundException ex) { ex.printStackTrace(); } } this.emitters.clear(); } }
private void finishJMX (final MemoryPoolMXBean pool) { assert pool != null; try { MemoryMXBean mbean = ManagementFactory.getMemoryMXBean(); ((NotificationEmitter)mbean).removeNotificationListener(this.notificationListener); } catch (ListenerNotFoundException e) { ErrorManager.getDefault().notify(e); } pool.setUsageThreshold(0); }