@Override
public void setAttribute(ObjectName name, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException,
InvalidAttributeValueException, MBeanException, ReflectionException {
Throwable error = null;
MBeanServerPlugin delegate = null;
final boolean readOnly = false;
try {
delegate = findDelegate(name);
authorizeMBeanOperation(delegate, name, SET_ATTRIBUTE, attribute.getName(), JmxAction.Impact.WRITE);
delegate.setAttribute(name, attribute);
} catch (Exception e) {
error = e;
if (e instanceof InstanceNotFoundException) throw (InstanceNotFoundException)e;
if (e instanceof AttributeNotFoundException) throw (AttributeNotFoundException)e;
if (e instanceof InvalidAttributeValueException) throw (InvalidAttributeValueException)e;
if (e instanceof MBeanException) throw (MBeanException)e;
if (e instanceof ReflectionException) throw (ReflectionException)e;
throw makeRuntimeException(e);
} finally {
if (shouldAuditLog(delegate, readOnly)) {
new MBeanServerAuditLogRecordFormatter(this, error, readOnly).setAttribute(name, attribute);
}
}
}