Search in sources :

Example 1 with ManagedNotification

use of org.springframework.jmx.export.metadata.ManagedNotification in project spring-framework by spring-projects.

the class AbstractConfigurableMBeanInfoAssembler method setNotificationInfos.

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;
}
Also used : ModelMBeanNotificationInfo(javax.management.modelmbean.ModelMBeanNotificationInfo) ManagedNotification(org.springframework.jmx.export.metadata.ManagedNotification)

Example 2 with ManagedNotification

use of org.springframework.jmx.export.metadata.ManagedNotification in project spring-framework by spring-projects.

the class MetadataMBeanInfoAssembler method getNotificationInfo.

/**
 * 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;
}
Also used : ModelMBeanNotificationInfo(javax.management.modelmbean.ModelMBeanNotificationInfo) ManagedNotification(org.springframework.jmx.export.metadata.ManagedNotification)

Aggregations

ModelMBeanNotificationInfo (javax.management.modelmbean.ModelMBeanNotificationInfo)2 ManagedNotification (org.springframework.jmx.export.metadata.ManagedNotification)2