for (int i = 0; i < notifInfo.length; i++) { log.info(" ** NAME: \t" + notifInfo[i].getName()); log.info(" DESCR: \t" + notifInfo[i].getDescription()); String notifTypes[] = notifInfo[i].getNotifTypes(); for (int j = 0; j < notifTypes.length; j++) {
/** {@inheritDoc} */ @Override protected JSONObject extractData(MBeanInfo pMBeanInfo, String pNotification) { JSONObject notMap = new JSONObject(); for (MBeanNotificationInfo notInfo : pMBeanInfo.getNotifications()) { if (pNotification == null || notInfo.getName().equals(pNotification)) { JSONObject map = new JSONObject(); map.put(NAME.getKey(), notInfo.getName()); map.put(DESCRIPTION.getKey(), notInfo.getDescription()); String[] types = notInfo.getNotifTypes(); JSONArray tList = new JSONArray(); for (String type : types) { tList.add(type); } map.put(TYPES.getKey(), tList); } } return notMap; } }
private void addNotifications(Map pMBeanMap,MBeanInfo pMBeanInfo) { Map notMap = new HashMap(); for (MBeanNotificationInfo notInfo : pMBeanInfo.getNotifications()) { Map map = new HashMap(); map.put(KEY_NAME,notInfo.getName()); map.put(KEY_DESCRIPTION,notInfo.getDescription()); map.put(KEY_TYPES,notInfo.getNotifTypes()); } if (notMap.size() > 0) { pMBeanMap.put(KEY_NOTIFICATION,notMap); } }
public String stringify(Object o) { final MBeanNotificationInfo notif = (MBeanNotificationInfo) o; String result = notif.getName() + ":"; final String[] notifTypes = notif.getNotifTypes(); result = result + ArrayStringifier.stringify(notifTypes, mOptions.mArrayDelimiter); if (mOptions.mIncludeDescription) { result = result + ",\"" + notif.getDescription() + "\""; } return (result); }
public String stringify(Object o) { final MBeanNotificationInfo notif = (MBeanNotificationInfo) o; String result = notif.getName() + ":"; final String[] notifTypes = notif.getNotifTypes(); result = result + ArrayStringifier.stringify(notifTypes, mOptions.mArrayDelimiter); if (mOptions.mIncludeDescription) { result = result + ",\"" + notif.getDescription() + "\""; } return (result); }
/** {@inheritDoc} */ @Override protected JSONObject extractData(MBeanInfo pMBeanInfo, String pNotification) { JSONObject notMap = new JSONObject(); for (MBeanNotificationInfo notInfo : pMBeanInfo.getNotifications()) { if (pNotification == null || notInfo.getName().equals(pNotification)) { JSONObject map = new JSONObject(); map.put(NAME.getKey(), notInfo.getName()); map.put(DESCRIPTION.getKey(), notInfo.getDescription()); String[] types = notInfo.getNotifTypes(); JSONArray tList = new JSONArray(); for (String type : types) { tList.add(type); } map.put(TYPES.getKey(), tList); } } return notMap; } }
/** {@inheritDoc} */ @Override protected JSONObject extractData(MBeanInfo pMBeanInfo, String pNotification) { JSONObject notMap = new JSONObject(); for (MBeanNotificationInfo notInfo : pMBeanInfo.getNotifications()) { if (pNotification == null || notInfo.getName().equals(pNotification)) { JSONObject map = new JSONObject(); map.put(NAME.getKey(), notInfo.getName()); map.put(DESCRIPTION.getKey(), notInfo.getDescription()); String[] types = notInfo.getNotifTypes(); JSONArray tList = new JSONArray(); for (String type : types) { tList.add(type); } map.put(TYPES.getKey(), tList); } } return notMap; } }
Map<String, Object> map = new HashMap<>(); map.put("name", notInfo.getName()); map.put("desc", notInfo.getDescription()); String[] types = notInfo.getNotifTypes(); List<String> tList = new ArrayList<>(types.length);
System.out.println("NI: " + ai.getName() + " -- " + ai.getDescription());
private void displayNotifications(MBeanInfo info) { Session session = getSession(); MBeanNotificationInfo[] notificationInfos = info.getNotifications(); if (notificationInfos.length == 0) { session.output.printMessage("there's no notifications"); return; } int index = 0; session.output.println(TEXT_NOTIFICATIONS); for (MBeanNotificationInfo notification : notificationInfos) { session.output.println(String.format(" %%%-3d - %s(%s)" + (showDescription ? ", %s" : ""), index++, notification.getName(), StringUtils.join(notification.getNotifTypes(), ","), notification.getDescription())); } }
private void displayNotifications( MBeanInfo info ) { Session session = getSession(); MBeanNotificationInfo[] notificationInfos = info.getNotifications(); if ( notificationInfos.length == 0 ) { session.output.printMessage( "there's no notifications" ); return; } int index = 0; session.output.println( TEXT_NOTIFICATIONS ); for ( MBeanNotificationInfo notification : notificationInfos ) { session.output.println( String.format( " %%%-3d - %s(%s)" + ( showDescription ? ", %s" : "" ), index++, notification.getName(), StringUtils.join( notification.getNotifTypes(), "," ), notification.getDescription() ) ); } }
notification.setAttribute("description", notifications[i].getDescription()); String[] types = notifications[i].getNotifTypes(); for (int j=0;j<types.length;j++)
notification.setAttribute("description", notifications[i].getDescription()); String[] types = notifications[i].getNotifTypes(); for (int j = 0; j < types.length; j++)
String[] types = notifInfo.getNotifTypes(); out.println(" <notification>"); out.println(" <description>" + notifInfo.getDescription() + "</description>"); out.println(" <name>" + notifInfo.getName() + "</name>"); for (int j = 0; j < types.length; j++)
public void serialize(QName name, Attributes attributes, Object value, SerializationContext context) throws IOException { MBeanNotificationInfo info = (MBeanNotificationInfo)value; context.startElement(name, attributes); context.serialize(NAME_QNAME, null, info.getName()); context.serialize(DESCRIPTION_QNAME, null, info.getDescription()); context.serialize(NOTIFICATION_TYPES_QNAME, null, info.getNotifTypes()); context.endElement(); }
mbeanNotInfo.getNotifTypes(), mbeanNotInfo.getName(), mbeanNotInfo.getDescription()); i++;
notifications[i].getNotifTypes(), notifications[i].getName(), notifications[i].getDescription() );
notifications[i].getNotifTypes(), notifications[i].getName(), notifications[i].getDescription() );