return (result == null) ? new ModelMBeanNotificationInfo[0] : result;
}
private ModelMBeanNotificationInfo[] extractNotificationMetadata(Object mapValue) {
if (mapValue instanceof ManagedNotification) {
ManagedNotification mn = (ManagedNotification) mapValue;
return new ModelMBeanNotificationInfo[] {JmxMetadataUtils.convertToModelMBeanNotificationInfo(mn)};
}
else if (mapValue instanceof Collection) {
Collection col = (Collection) mapValue;
List result = new ArrayList();
for (Iterator iterator = col.iterator(); iterator.hasNext();) {
Object colValue = iterator.next();
if (!(colValue instanceof ManagedNotification)) {
throw new IllegalArgumentException(
"Property 'notificationInfoMappings' only accepts ManagedNotifications for Map values");
}
ManagedNotification mn = (ManagedNotification) colValue;
result.add(JmxMetadataUtils.convertToModelMBeanNotificationInfo(mn));
}
return (ModelMBeanNotificationInfo[]) result.toArray(new ModelMBeanNotificationInfo[result.size()]);
}
else {