Set the value of a specific attribute of this MBean.
// Validate the input parameters
if (attribute == null)
throw new RuntimeOperationsException
(new IllegalArgumentException("Attribute is null"),
"Attribute is null");
String name = attribute.getName();
Object value = attribute.getValue();
if (name == null)
throw new RuntimeOperationsException
(new IllegalArgumentException("Attribute name is null"),
"Attribute name is null");
CoyoteConnector connector = null;
try {
connector = (CoyoteConnector) getManagedResource();
} catch (InstanceNotFoundException e) {
throw new MBeanException(e);
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
if (("algorithm").equals(name) || ("keystoreType").equals(name) ||
("maxThreads").equals(name) || ("maxSpareThreads").equals(name) ||
("minSpareThreads").equals(name)) {
if (("keystoreType").equals(name)) {
name = "keyType";
}
ProtocolHandler protocolHandler = connector.getProtocolHandler();
/* check the Protocol first, since JkCoyote has an independent
* configure method.
*/
try {
if( protocolHandler != null ) {
IntrospectionUtils.setAttribute(protocolHandler, name, value);
}
} catch (Exception e) {
throw new MBeanException(e);
}
} else {
super.setAttribute(attribute);
}