/** * Convert the supplied {@link ManagedNotification} into the corresponding * {@link javax.management.modelmbean.ModelMBeanNotificationInfo}. */ public static ModelMBeanNotificationInfo convertToModelMBeanNotificationInfo(ManagedNotification notificationInfo) { String[] notifTypes = notificationInfo.getNotificationTypes(); if (ObjectUtils.isEmpty(notifTypes)) { throw new IllegalArgumentException("Must specify at least one notification type"); } String name = notificationInfo.getName(); if (!StringUtils.hasText(name)) { throw new IllegalArgumentException("Must specify notification name"); } String description = notificationInfo.getDescription(); return new ModelMBeanNotificationInfo(notifTypes, name, description); }
/** * Create and return a <code>ModelMBeanNotificationInfo</code> object that * corresponds to the attribute described by this instance. */ public ModelMBeanNotificationInfo createNotificationInfo() { // Return our cached information (if any) if (info != null) return (info); // Create and return a new information object info = new ModelMBeanNotificationInfo (getNotifTypes(), getName(), getDescription()); Descriptor descriptor = info.getDescriptor(); addFields(descriptor); info.setDescriptor(descriptor); return (info); }
/** * Convert the supplied {@link ManagedNotification} into the corresponding * {@link javax.management.modelmbean.ModelMBeanNotificationInfo}. */ public static ModelMBeanNotificationInfo convertToModelMBeanNotificationInfo(ManagedNotification notificationInfo) { String[] notifTypes = notificationInfo.getNotificationTypes(); if (ObjectUtils.isEmpty(notifTypes)) { throw new IllegalArgumentException("Must specify at least one notification type"); } String name = notificationInfo.getName(); if (!StringUtils.hasText(name)) { throw new IllegalArgumentException("Must specify notification name"); } String description = notificationInfo.getDescription(); return new ModelMBeanNotificationInfo(notifTypes, name, description); }
public void addModelMBeanNotification(String[] type, String className, String description, Descriptor desc) { notifications.put(className, new ModelMBeanNotificationInfo(type, className, description, desc)); }
public void addModelMBeanNotification(String[] type, String className, String description, Descriptor desc) { notifications.put(className, new ModelMBeanNotificationInfo(type, className, description, desc)); }
/** * @return notificationInfo */ public final MBeanNotificationInfo[] getNotificationInfo() { MBeanNotificationInfo[] result = new MBeanNotificationInfo[2]; Descriptor genericDescriptor = new DescriptorSupport(new String[] { "name=GENERIC", "descriptorType=notification", "LOGGER=T", "severity=5", "displayName=jmx.modelmbean.generic" }); result[0] = new ModelMBeanNotificationInfo(new String[] {"jmx.modelmbean.generic" }, "GENERIC", "A text notification has been issued by the managed resource", genericDescriptor); Descriptor attributeDescriptor = new DescriptorSupport(new String[] {"name=ATTRIBUTE_CHANGE", "descriptorType=notification", "LOGGER=T", "severity=5", "displayName=jmx.attribute.change" }); result[1] = new ModelMBeanNotificationInfo(new String[] {"jmx.attribute.change" }, "ATTRIBUTE_CHANGE", "Signifies that an observed MBean attribute value has changed", attributeDescriptor); return result; }
/** * Convert the supplied {@link ManagedNotification} into the corresponding * {@link javax.management.modelmbean.ModelMBeanNotificationInfo}. */ public static ModelMBeanNotificationInfo convertToModelMBeanNotificationInfo(ManagedNotification notificationInfo) { String[] notifTypes = notificationInfo.getNotificationTypes(); if (ObjectUtils.isEmpty(notifTypes)) { throw new IllegalArgumentException("Must specify at least one notification type"); } String name = notificationInfo.getName(); if (!StringUtils.hasText(name)) { throw new IllegalArgumentException("Must specify notification name"); } String description = notificationInfo.getDescription(); return new ModelMBeanNotificationInfo(notifTypes, name, description); }
protected ModelMBeanNotificationInfo[] buildNotificationInfo(List notifications) throws NotCompliantMBeanException { List infos = new ArrayList(); for (Iterator it = notifications.iterator(); it.hasNext();) { Element notif = (Element) it.next(); String name = notif.elementTextTrim("name"); String description = notif.elementTextTrim("description"); List notifTypes = notif.elements("notification-type"); Descriptor descr = getDescriptor(notif, name, NOTIFICATION_DESCRIPTOR); List types = new ArrayList(); for (Iterator iterator = notifTypes.iterator(); iterator.hasNext();) { Element type = (Element) iterator.next(); types.add(type.getTextTrim()); } ModelMBeanNotificationInfo info = new ModelMBeanNotificationInfo( (String[]) types.toArray(new String[types.size()]), name, description, descr); infos.add(info); } return (ModelMBeanNotificationInfo[]) infos.toArray( new ModelMBeanNotificationInfo[infos.size()] ); }
protected ModelMBeanNotificationInfo[] buildNotificationInfo(List notifications) throws NotCompliantMBeanException { List infos = new ArrayList(); for (Iterator it = notifications.iterator(); it.hasNext();) { Element notif = (Element) it.next(); String name = notif.elementTextTrim("name"); String description = notif.elementTextTrim("description"); List notifTypes = notif.elements("notification-type"); Descriptor descr = getDescriptor(notif, name, NOTIFICATION_DESCRIPTOR); List types = new ArrayList(); for (Iterator iterator = notifTypes.iterator(); iterator.hasNext();) { Element type = (Element) iterator.next(); types.add(type.getTextTrim()); } ModelMBeanNotificationInfo info = new ModelMBeanNotificationInfo( (String[]) types.toArray(new String[types.size()]), name, description, descr); infos.add(info); } return (ModelMBeanNotificationInfo[]) infos.toArray( new ModelMBeanNotificationInfo[infos.size()] ); }
"severity=5", "displayName=jmx.modelmbean.generic" }); response[0] = new ModelMBeanNotificationInfo (new String[] { "jmx.modelmbean.generic" }, "GENERIC", "severity=5", "displayName=jmx.attribute.change" }); response[1] = new ModelMBeanNotificationInfo (new String[] { "jmx.attribute.change" }, "ATTRIBUTE_CHANGE",
public Object instantiate() { if (descriptor != null) { if (descriptor.getFieldValue(ModelMBeanConstants.NAME) == null) { descriptor.setField(ModelMBeanConstants.NAME, name); } if (descriptor.getFieldValue(ModelMBeanConstants.DESCRIPTOR_TYPE) == null) { descriptor.setField(ModelMBeanConstants.DESCRIPTOR_TYPE, ModelMBeanConstants.NOTIFICATION_DESCRIPTOR); } } String[] ntypes = new String[types.size()]; types.toArray(ntypes); ModelMBeanNotificationInfo info = new ModelMBeanNotificationInfo( ntypes, name, description, descriptor); return info; }
public Object instantiate() { if (descriptor != null) { if (descriptor.getFieldValue(ModelMBeanConstants.NAME) == null) { descriptor.setField(ModelMBeanConstants.NAME, name); } if (descriptor.getFieldValue(ModelMBeanConstants.DESCRIPTOR_TYPE) == null) { descriptor.setField(ModelMBeanConstants.DESCRIPTOR_TYPE, ModelMBeanConstants.NOTIFICATION_DESCRIPTOR); } } String[] ntypes = new String[types.size()]; types.toArray(ntypes); ModelMBeanNotificationInfo info = new ModelMBeanNotificationInfo( ntypes, name, description, descriptor); return info; }
for ( MBeanNotificationInfo mbeanNotInfo : mbeanNotInfos ) notificationInfos[i] = new ModelMBeanNotificationInfo( mbeanNotInfo.getNotifTypes(), mbeanNotInfo.getName(),
mmbNotifications[i] = new ModelMBeanNotificationInfo( notifications[i].getNotifTypes(), notifications[i].getName(),
mmbNotifications[i] = new ModelMBeanNotificationInfo( notifications[i].getNotifTypes(), notifications[i].getName(),