protected void removeNotificationListenerFromResource(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException { if (resource instanceof NotificationEmitter) { ((NotificationEmitter) resource).removeNotificationListener(listener, filter, handback); } else if (resource instanceof NotificationBroadcaster) { //JGH NOTE: looks like a listener against the MBeanServer is //wrapped as a XMBean which has a broadcaster that is an NotificationEmitter //but this resource target is a NotificationBroadcaster, in which case, //w/o this .. you'll get a resource failure below removeNotificationListener(listener); } else { throw new RuntimeMBeanException(new IllegalArgumentException("Target XXX is not a notification emitter" // FIXME: add the XXX object name, store from registration )); } }
protected void removeNotificationListenerFromResource(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException { if (resource instanceof NotificationEmitter) { ((NotificationEmitter) resource).removeNotificationListener(listener, filter, handback); } else if (resource instanceof NotificationBroadcaster) { //JGH NOTE: looks like a listener against the MBeanServer is //wrapped as a XMBean which has a broadcaster that is an NotificationEmitter //but this resource target is a NotificationBroadcaster, in which case, //w/o this .. you'll get a resource failure below removeNotificationListener(listener); } else { throw new RuntimeMBeanException(new IllegalArgumentException("Target XXX is not a notification emitter" // FIXME: add the XXX object name, store from registration )); } }