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)) {
MODELMBEAN_LOGGER.logp(Level.FINER,
RequiredModelMBean.class.getName(), mth,
"Set attribute change filter to " +
currFilter.getEnabledAttributes().firstElement());
}
attributeBroadcaster.addNotificationListener(inlistener,currFilter,
inhandback);
if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {