@Override public Object instantiate(String className, Object[] params, String[] signature) throws ReflectionException, MBeanException { params = nullAsEmpty(params); signature = nullAsEmpty(signature); Throwable error = null; MBeanServerPlugin delegate = rootMBeanServer; final boolean readOnly = false; try { //Special authorization authorizeClassloadingOperation(delegate, INSTANTIATE); return delegate.instantiate(className, params, signature); } catch (Exception e) { error = e; if (e instanceof ReflectionException) throw (ReflectionException)e; if (e instanceof MBeanException) throw (MBeanException)e; throw makeRuntimeException(e); } finally { if (shouldAuditLog(delegate, readOnly)) { new MBeanServerAuditLogRecordFormatter(this, error, readOnly).instantiate(className, params, signature); } } }
@Override public Object instantiate(String className, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, MBeanException, InstanceNotFoundException { params = nullAsEmpty(params); signature = nullAsEmpty(signature); Throwable error = null; MBeanServerPlugin delegate = rootMBeanServer; final boolean readOnly = false; try { //Special authorization authorizeClassloadingOperation(delegate, loaderName, INSTANTIATE); return delegate.instantiate(className, loaderName, params, signature); } catch (Exception e) { error = e; if (e instanceof ReflectionException) throw (ReflectionException)e; if (e instanceof MBeanException) throw (MBeanException)e; if (e instanceof InstanceNotFoundException) throw (InstanceNotFoundException)e; throw makeRuntimeException(e); } finally { if (shouldAuditLog(delegate, readOnly)) { new MBeanServerAuditLogRecordFormatter(this, error, readOnly).instantiate(className, loaderName, params, signature); } } }
@Override public Object instantiate(String className, Object[] params, String[] signature) throws ReflectionException, MBeanException { params = nullAsEmpty(params); signature = nullAsEmpty(signature); Throwable error = null; MBeanServerPlugin delegate = rootMBeanServer; final boolean readOnly = false; try { if (delegate.shouldAuthorize()) { authorizeSuperUserOrAdministrator(INSTANTIATE); } return delegate.instantiate(className, params, signature); } catch (Exception e) { error = e; if (e instanceof ReflectionException) throw (ReflectionException)e; if (e instanceof MBeanException) throw (MBeanException)e; throw makeRuntimeException(e); } finally { if (shouldAuditLog(delegate, readOnly)) { new MBeanServerAuditLogRecordFormatter(this, error, readOnly).instantiate(className, params, signature); } } }
@Override public Object instantiate(String className, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, MBeanException, InstanceNotFoundException { params = nullAsEmpty(params); signature = nullAsEmpty(signature); Throwable error = null; MBeanServerPlugin delegate = rootMBeanServer; final boolean readOnly = false; try { if (delegate.shouldAuthorize()) { authorizeSuperUserOrAdministrator(INSTANTIATE); } return delegate.instantiate(className, loaderName, params, signature); } catch (Exception e) { error = e; if (e instanceof ReflectionException) throw (ReflectionException)e; if (e instanceof MBeanException) throw (MBeanException)e; if (e instanceof InstanceNotFoundException) throw (InstanceNotFoundException)e; throw makeRuntimeException(e); } finally { if (shouldAuditLog(delegate, readOnly)) { new MBeanServerAuditLogRecordFormatter(this, error, readOnly).instantiate(className, loaderName, params, signature); } } }
@Override public ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanException, NotCompliantMBeanException { params = nullAsEmpty(params); signature = nullAsEmpty(signature); Throwable error = null; MBeanServerPlugin delegate = null; final boolean readOnly = false; try { delegate = findDelegateForNewObject(name); authorizeMBeanOperation(delegate, name, CREATE_MBEAN, null, JmxAction.Impact.WRITE); return checkNotAReservedDomainRegistrationIfObjectNameWasChanged(name, delegate.createMBean(className, name, params, signature), delegate); } catch (Exception e) { error = e; if (e instanceof ReflectionException) throw (ReflectionException)e; if (e instanceof InstanceAlreadyExistsException) throw (InstanceAlreadyExistsException)e; if (e instanceof MBeanException) throw (MBeanException)e; if (e instanceof NotCompliantMBeanException) throw (NotCompliantMBeanException)e; throw makeRuntimeException(e); } finally { if (shouldAuditLog(delegate, readOnly)) { new MBeanServerAuditLogRecordFormatter(this, error, readOnly).createMBean(className, name, params, signature); } } }
@Override public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException { params = nullAsEmpty(params); signature = nullAsEmpty(signature); Throwable error = null; MBeanServerPlugin delegate = null; final boolean readOnly = false; try { delegate = findDelegateForNewObject(name); authorizeMBeanOperation(delegate, name, CREATE_MBEAN, null, JmxAction.Impact.WRITE); return checkNotAReservedDomainRegistrationIfObjectNameWasChanged(name, delegate.createMBean(className, name, loaderName, params, signature), delegate); } catch (Exception e) { error = e; if (e instanceof ReflectionException) throw (ReflectionException)e; if (e instanceof InstanceAlreadyExistsException) throw (InstanceAlreadyExistsException)e; if (e instanceof MBeanException) throw (MBeanException)e; if (e instanceof NotCompliantMBeanException) throw (NotCompliantMBeanException)e; if (e instanceof InstanceNotFoundException) throw (InstanceNotFoundException)e; throw makeRuntimeException(e); } finally { if (shouldAuditLog(delegate, readOnly)) { new MBeanServerAuditLogRecordFormatter(this, error, readOnly).createMBean(className, name, params, signature); } } }
@Override public ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanException, NotCompliantMBeanException { params = nullAsEmpty(params); signature = nullAsEmpty(signature); Throwable error = null; MBeanServerPlugin delegate = null; final boolean readOnly = false; try { delegate = findDelegateForNewObject(name); if (delegate.shouldAuthorize()) { authorizeSensitiveOperation(CREATE_MBEAN, readOnly, true); } return delegate.createMBean(className, name, params, signature); } catch (Exception e) { error = e; if (e instanceof ReflectionException) throw (ReflectionException)e; if (e instanceof InstanceAlreadyExistsException) throw (InstanceAlreadyExistsException)e; if (e instanceof MBeanException) throw (MBeanException)e; if (e instanceof NotCompliantMBeanException) throw (NotCompliantMBeanException)e; throw makeRuntimeException(e); } finally { if (shouldAuditLog(delegate, readOnly)) { new MBeanServerAuditLogRecordFormatter(this, error, readOnly).createMBean(className, name, params, signature); } } }
@Override public Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException { params = nullAsEmpty(params); signature = nullAsEmpty(signature); Throwable error = null; MBeanServerPlugin delegate = findDelegate(name); boolean readOnly = false; try { //Need to determine impact of the operation readOnly = isOperationReadOnly(name, operationName, signature); delegate = findDelegate(name); authorizeMBeanOperation(delegate, name, INVOKE, null, readOnly ? JmxAction.Impact.READ_ONLY : JmxAction.Impact.WRITE); return delegate.invoke(name, operationName, params, signature); } catch (Exception e) { error = e; if (e instanceof ReflectionException) throw (ReflectionException)e; if (e instanceof MBeanException) throw (MBeanException)e; if (e instanceof InstanceNotFoundException) throw (InstanceNotFoundException)e; throw makeRuntimeException(e); } finally { if (shouldAuditLog(delegate, readOnly)) { new MBeanServerAuditLogRecordFormatter(this, error, readOnly).invoke(name, operationName, params, signature); } } }
@Override public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException { params = nullAsEmpty(params); signature = nullAsEmpty(signature); Throwable error = null; MBeanServerPlugin delegate = null; final boolean readOnly = false; try { delegate = findDelegateForNewObject(name); if (delegate.shouldAuthorize()) { authorizeSensitiveOperation(CREATE_MBEAN, readOnly, true); } return delegate.createMBean(className, name, loaderName, params, signature); } catch (Exception e) { error = e; if (e instanceof ReflectionException) throw (ReflectionException)e; if (e instanceof InstanceAlreadyExistsException) throw (InstanceAlreadyExistsException)e; if (e instanceof MBeanException) throw (MBeanException)e; if (e instanceof NotCompliantMBeanException) throw (NotCompliantMBeanException)e; if (e instanceof InstanceNotFoundException) throw (InstanceNotFoundException)e; throw makeRuntimeException(e); } finally { if (shouldAuditLog(delegate, readOnly)) { new MBeanServerAuditLogRecordFormatter(this, error, readOnly).createMBean(className, name, params, signature); } } }
@Override public Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException { params = nullAsEmpty(params); signature = nullAsEmpty(signature); Throwable error = null; MBeanServerPlugin delegate = findDelegate(name); boolean readOnly = false; try { //Need to determine impact of the operation readOnly = isOperationReadOnly(name, operationName, signature); delegate = findDelegate(name); if (delegate.shouldAuthorize()) { authorizeSensitiveOperation(INVOKE, readOnly, true); } return delegate.invoke(name, operationName, params, signature); } catch (Exception e) { error = e; if (e instanceof ReflectionException) throw (ReflectionException)e; if (e instanceof MBeanException) throw (MBeanException)e; if (e instanceof InstanceNotFoundException) throw (InstanceNotFoundException)e; throw makeRuntimeException(e); } finally { if (shouldAuditLog(delegate, readOnly)) { new MBeanServerAuditLogRecordFormatter(this, error, readOnly).invoke(name, operationName, params, signature); } } }