@Override public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException { Throwable error = null; MBeanServerPlugin delegate = null; final boolean readOnly = true; try { // findDelegate does not work for a pattern ObjectName delegate = findDelegateForNewObject(name); authorizeMBeanOperation(delegate, name, ADD_NOTIFICATION_LISTENER, null, JmxAction.Impact.READ_ONLY); delegate.addNotificationListener(name, listener, filter, handback); } catch (Exception e) { error = e; if (e instanceof InstanceNotFoundException) throw (InstanceNotFoundException)e; if (e instanceof RuntimeException) throw (RuntimeException)e; throw makeRuntimeException(e); } finally { if (shouldAuditLog(delegate, readOnly)) { new MBeanServerAuditLogRecordFormatter(this, error, readOnly).addNotificationListener(name, listener, filter, handback); } } }
@Override public void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException { Throwable error = null; MBeanServerPlugin delegate = null; final boolean readOnly = true; try { delegate = findDelegateForNewObject(name); authorizeMBeanOperation(delegate, name, ADD_NOTIFICATION_LISTENER, null, JmxAction.Impact.READ_ONLY); delegate.addNotificationListener(name, listener, filter, handback); } catch (Exception e) { error = e; if (e instanceof InstanceNotFoundException) throw (InstanceNotFoundException)e; if (e instanceof RuntimeException) throw (RuntimeException)e; throw makeRuntimeException(e); } finally { if (shouldAuditLog(delegate, readOnly)) { new MBeanServerAuditLogRecordFormatter(this, error, readOnly).addNotificationListener(name, listener, filter, handback); } } }
@Override public void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException { Throwable error = null; MBeanServerPlugin delegate = null; final boolean readOnly = true; try { delegate = findDelegateForNewObject(name); if (delegate.shouldAuthorize()) { authorizeSensitiveOperation(ADD_NOTIFICATION_LISTENER, readOnly, true); } delegate.addNotificationListener(name, listener, filter, handback); } catch (Exception e) { error = e; if (e instanceof InstanceNotFoundException) throw (InstanceNotFoundException)e; if (e instanceof RuntimeException) throw (RuntimeException)e; throw makeRuntimeException(e); } finally { if (shouldAuditLog(delegate, readOnly)) { new MBeanServerAuditLogRecordFormatter(this, error, readOnly).addNotificationListener(name, listener, filter, handback); } } }
@Override public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException { Throwable error = null; MBeanServerPlugin delegate = null; final boolean readOnly = true; try { // findDelegate does not work for a pattern ObjectName delegate = findDelegateForNewObject(name); if (delegate.shouldAuthorize()) { authorizeSensitiveOperation(ADD_NOTIFICATION_LISTENER, readOnly, true); } delegate.addNotificationListener(name, listener, filter, handback); } catch (Exception e) { error = e; if (e instanceof InstanceNotFoundException) throw (InstanceNotFoundException)e; if (e instanceof RuntimeException) throw (RuntimeException)e; throw makeRuntimeException(e); } finally { if (shouldAuditLog(delegate, readOnly)) { new MBeanServerAuditLogRecordFormatter(this, error, readOnly).addNotificationListener(name, listener, filter, handback); } } }