public void setNotificationInfos(ManagedNotification[] notificationInfos) { ModelMBeanNotificationInfo[] infos = new ModelMBeanNotificationInfo[notificationInfos.length]; for (int i = 0; i < notificationInfos.length; i++) { ManagedNotification notificationInfo = notificationInfos[i]; infos[i] = JmxMetadataUtils.convertToModelMBeanNotificationInfo(notificationInfo); } this.notificationInfos = infos; }
public void setNotificationInfos(ManagedNotification[] notificationInfos) { ModelMBeanNotificationInfo[] infos = new ModelMBeanNotificationInfo[notificationInfos.length]; for (int i = 0; i < notificationInfos.length; i++) { ManagedNotification notificationInfo = notificationInfos[i]; infos[i] = JmxMetadataUtils.convertToModelMBeanNotificationInfo(notificationInfo); } this.notificationInfos = infos; }
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<ModelMBeanNotificationInfo> result = new ArrayList<>(); for (Object colValue : col) { 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 result.toArray(new ModelMBeanNotificationInfo[0]); } else { throw new IllegalArgumentException( "Property 'notificationInfoMappings' only accepts ManagedNotifications for Map values"); } }
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<ModelMBeanNotificationInfo> result = new ArrayList<>(); for (Object colValue : col) { 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 result.toArray(new ModelMBeanNotificationInfo[0]); } else { throw new IllegalArgumentException( "Property 'notificationInfoMappings' only accepts ManagedNotifications for Map values"); } }
/** * Reads the {@link ManagedNotification} metadata from the {@code Class} of the managed resource * and generates and returns the corresponding {@link ModelMBeanNotificationInfo} metadata. */ @Override protected ModelMBeanNotificationInfo[] getNotificationInfo(Object managedBean, String beanKey) { ManagedNotification[] notificationAttributes = obtainAttributeSource().getManagedNotifications(getClassToExpose(managedBean)); ModelMBeanNotificationInfo[] notificationInfos = new ModelMBeanNotificationInfo[notificationAttributes.length]; for (int i = 0; i < notificationAttributes.length; i++) { ManagedNotification attribute = notificationAttributes[i]; notificationInfos[i] = JmxMetadataUtils.convertToModelMBeanNotificationInfo(attribute); } return notificationInfos; }
/** * Reads the {@link ManagedNotification} metadata from the {@code Class} of the managed resource * and generates and returns the corresponding {@link ModelMBeanNotificationInfo} metadata. */ @Override protected ModelMBeanNotificationInfo[] getNotificationInfo(Object managedBean, String beanKey) { ManagedNotification[] notificationAttributes = obtainAttributeSource().getManagedNotifications(getClassToExpose(managedBean)); ModelMBeanNotificationInfo[] notificationInfos = new ModelMBeanNotificationInfo[notificationAttributes.length]; for (int i = 0; i < notificationAttributes.length; i++) { ManagedNotification attribute = notificationAttributes[i]; notificationInfos[i] = JmxMetadataUtils.convertToModelMBeanNotificationInfo(attribute); } return notificationInfos; }
public void setNotificationInfos(ManagedNotification[] notificationInfos) { ModelMBeanNotificationInfo[] infos = new ModelMBeanNotificationInfo[notificationInfos.length]; for (int i = 0; i < notificationInfos.length; i++) { ManagedNotification notificationInfo = notificationInfos[i]; infos[i] = JmxMetadataUtils.convertToModelMBeanNotificationInfo(notificationInfo); } this.notificationInfos = infos; }
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<ModelMBeanNotificationInfo> result = new ArrayList<>(); for (Object colValue : col) { 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 result.toArray(new ModelMBeanNotificationInfo[0]); } else { throw new IllegalArgumentException( "Property 'notificationInfoMappings' only accepts ManagedNotifications for Map values"); } }
/** * Reads the {@link ManagedNotification} metadata from the {@code Class} of the managed resource * and generates and returns the corresponding {@link javax.management.modelmbean.ModelMBeanNotificationInfo} metadata. */ @Override @Nonnull protected ModelMBeanNotificationInfo[] getNotificationInfo(Object managedBean, String beanKey) { Class intf = findJmxInterface(beanKey, AopUtils.getTargetClass(managedBean)); ManagedNotification[] notificationAttributes = this.attributeSource.getManagedNotifications(intf); ModelMBeanNotificationInfo[] notificationInfos = new ModelMBeanNotificationInfo[notificationAttributes.length]; for (int i = 0; i < notificationAttributes.length; i++) { ManagedNotification attribute = notificationAttributes[i]; notificationInfos[i] = JmxMetadataUtils.convertToModelMBeanNotificationInfo(attribute); } return notificationInfos; }
/** * Reads the {@link ManagedNotification} metadata from the {@code Class} of the managed resource * and generates and returns the corresponding {@link ModelMBeanNotificationInfo} metadata. */ @Override protected ModelMBeanNotificationInfo[] getNotificationInfo(Object managedBean, String beanKey) { ManagedNotification[] notificationAttributes = obtainAttributeSource().getManagedNotifications(getClassToExpose(managedBean)); ModelMBeanNotificationInfo[] notificationInfos = new ModelMBeanNotificationInfo[notificationAttributes.length]; for (int i = 0; i < notificationAttributes.length; i++) { ManagedNotification attribute = notificationAttributes[i]; notificationInfos[i] = JmxMetadataUtils.convertToModelMBeanNotificationInfo(attribute); } return notificationInfos; }