private MBeanInfo getMBeanInfo(ObjectName name, boolean logAndAuthorize, boolean nullIfNotFound) throws InstanceNotFoundException, IntrospectionException, ReflectionException { Throwable error = null; MBeanServerPlugin delegate = null; final boolean readOnly = true; try { delegate = findDelegate(name); if (logAndAuthorize) { authorizeMBeanOperation(delegate, name, GET_MBEAN_INFO, null, JmxAction.Impact.READ_ONLY); } return delegate.getMBeanInfo(name); } catch (Exception e) { if (nullIfNotFound) { return null; } error = e; if (e instanceof InstanceNotFoundException) throw (InstanceNotFoundException)e; if (e instanceof IntrospectionException) throw (IntrospectionException)e; if (e instanceof ReflectionException) throw (ReflectionException)e; throw makeRuntimeException(e); } finally { if (logAndAuthorize && shouldAuditLog(delegate, readOnly)) { new MBeanServerAuditLogRecordFormatter(this, error, readOnly).getMBeanInfo(name); } } }
private MBeanInfo getMBeanInfo(ObjectName name, boolean logAndAuthorize, boolean nullIfNotFound) throws InstanceNotFoundException, IntrospectionException, ReflectionException { Throwable error = null; MBeanServerPlugin delegate = null; final boolean readOnly = true; try { delegate = findDelegate(name); if (delegate.shouldAuthorize() && logAndAuthorize) { authorizeSensitiveOperation(GET_MBEAN_INFO, readOnly, true); } return delegate.getMBeanInfo(name); } catch (Exception e) { if (nullIfNotFound) { return null; } error = e; if (e instanceof InstanceNotFoundException) throw (InstanceNotFoundException)e; if (e instanceof IntrospectionException) throw (IntrospectionException)e; if (e instanceof ReflectionException) throw (ReflectionException)e; throw makeRuntimeException(e); } finally { if (logAndAuthorize && shouldAuditLog(delegate, readOnly)) { new MBeanServerAuditLogRecordFormatter(this, error, readOnly).getMBeanInfo(name); } } }