@Override
public AttributeList setAttributes(ObjectName name, AttributeList attributes) throws InstanceNotFoundException,
ReflectionException {
Throwable error = null;
MBeanServerPlugin delegate = null;
final boolean readOnly = false;
try {
delegate = findDelegate(name);
for( Attribute attribute : attributes.asList()) {
authorizeMBeanOperation(delegate, name, SET_ATTRIBUTES, attribute.getName(), JmxAction.Impact.WRITE);
}
return delegate.setAttributes(name, attributes);
} catch (Exception e) {
error = e;
if (e instanceof InstanceNotFoundException) throw (InstanceNotFoundException)e;
if (e instanceof ReflectionException) throw (ReflectionException)e;
throw makeRuntimeException(e);
} finally {
if (shouldAuditLog(delegate, readOnly)) {
new MBeanServerAuditLogRecordFormatter(this, error, readOnly).setAttributes(name, attributes);
}
}
}