if (attributeBroadcaster == null)
attributeBroadcaster = new NotificationBroadcasterSupport();
AttributeChangeNotificationFilter currFilter =
new AttributeChangeNotificationFilter();
MBeanAttributeInfo[] attrInfo = modelMBeanInfo.getAttributes();
boolean found = false;
if (inAttributeName == null) {
if ((attrInfo != null) && (attrInfo.length>0)) {
for (int i=0; i<attrInfo.length; i++) {
currFilter.enableAttribute(attrInfo[i].getName());
}
}
} else {
if ((attrInfo != null) && (attrInfo.length>0)) {
for (int i=0; i<attrInfo.length; i++) {
if (inAttributeName.equals(attrInfo[i].getName())) {
found = true;
currFilter.enableAttribute(inAttributeName);
break;
}
}
}
if (!found) {
throw new RuntimeOperationsException(new
IllegalArgumentException(
"The attribute name does not exist"),
"Exception occurred trying to add an "+
"AttributeChangeNotification listener");
}
}
if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
Vector<String> enabledAttrs = currFilter.getEnabledAttributes();
String s = (enabledAttrs.size() > 1) ?
"[" + enabledAttrs.firstElement() + ", ...]" :
enabledAttrs.toString();
MODELMBEAN_LOGGER.logp(Level.FINER,
RequiredModelMBean.class.getName(), mth,