throw new RuntimeOperationsException
(new IllegalArgumentException("Attribute name is null"),
"Attribute name is null");
// Look up the actual operation to be used
ModelMBeanAttributeInfo attrInfo = info.getAttribute(name);
if (attrInfo == null)
throw new AttributeNotFoundException
("Cannot find attribute " + name);
Descriptor attrDesc = attrInfo.getDescriptor();
if (attrDesc == null)
throw new AttributeNotFoundException
("Cannot find attribute " + name + " descriptor");
String setMethod = (String) attrDesc.getFieldValue("setMethod");
if (setMethod == null)
throw new AttributeNotFoundException
("Cannot find attribute " + name + " set method name");
// Invoke the specified set method and ignore any results
invoke(setMethod,
new Object[] { value },
new String[] { attrInfo.getType() });
}