/** * @see NotificationEmitter#getNotificationInfo() */ @Override public MBeanNotificationInfo[] getNotificationInfo() { return getMBeanInfo().getNotifications(); }
log.info(" ** No operations ** "); log.info("NOTIFICATIONS"); MBeanNotificationInfo[] notifInfo = info.getNotifications(); if (notifInfo.length > 0) { for (int i = 0; i < notifInfo.length; i++) {
return info.getNotifications();
private MBeanInfo getWrappedInfo(MBeanInfo pMBeanInfo) { MBeanAttributeInfo[] attrInfo = getWrappedAttributeInfo(pMBeanInfo); MBeanOperationInfo[] opInfo = getWrappedOperationInfo(pMBeanInfo); return new MBeanInfo(pMBeanInfo.getClassName(), pMBeanInfo.getDescription(), attrInfo, null, /* We dont allow construction of this MBean, hence null-constructors */ opInfo, pMBeanInfo.getNotifications() ); }
/** {@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; } }
public Object perform(Object[] args) throws Throwable { return mbeanServerConnection.getMBeanInfo(objectName).getNotifications(); } }
/** * @see NotificationEmitter#getNotificationInfo() */ public MBeanNotificationInfo[] getNotificationInfo() { return getMBeanInfo().getNotifications(); }
public Object perform(Object[] args) throws Throwable { return mbeanServerConnection.getMBeanInfo(objectName).getNotifications(); } }
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); } }
/** * Get the {@link MBeanNotificationInfo} descriptors for the specified MBean. * @param mBeanName the name of the MBean. * @return a an array of {@link MBeanNotificationInfo}, which is empty if the MBean does not implement {@link NotificationBroadcaster}. * @throws Exception if any error occurs. */ public MBeanNotificationInfo[] getNotificationInfo(final String mBeanName) throws Exception { return mbeanConnection.get().getMBeanInfo(ObjectNameCache.getObjectName(mBeanName)).getNotifications(); }
public static void main(String[] args) throws NotCompliantMBeanException { // 获取 Greeting 的 MBeanInfo MBeanInfo mBeanInfo = Introspector.testCompliance(Greeting.class); printf("Greeting 的 MBeanInfo 详情:"); printf("MBeanAttributeInfo[]:%s", Arrays.asList(mBeanInfo.getAttributes())); printf("MBeanOperationInfo[]:%s", Arrays.asList(mBeanInfo.getOperations())); printf("MBeanConstructorInfo[]:%s", Arrays.asList(mBeanInfo.getConstructors())); printf("MBeanNotificationInfo[]:%s", Arrays.asList(mBeanInfo.getNotifications())); }
@Override public MBeanInfo getMBeanInfo() { MBeanInfo info = super.getMBeanInfo(); return new MBeanInfo(info.getClassName(), info.getDescription(), info.getAttributes(), info.getConstructors(), fillMBeanOperationInfo(), info.getNotifications()); }
@Override public MBeanInfo getMBeanInfo() { MBeanInfo info = super.getMBeanInfo(); return new MBeanInfo(info.getClassName(), info.getDescription(), info.getAttributes(), info.getConstructors(), fillMBeanOperationInfo(), info.getNotifications()); }
@Override public MBeanInfo getMBeanInfo() { MBeanInfo info = super.getMBeanInfo(); return new MBeanInfo(info.getClassName(), info.getDescription(), info.getAttributes(), info.getConstructors(), MBeanInfoHelper.getMBeanOperationsInfo(TopicControl.class), info.getNotifications()); }
private MBeanInfo getWrappedInfo(MBeanInfo pMBeanInfo) { MBeanAttributeInfo[] attrInfo = getWrappedAttributeInfo(pMBeanInfo); MBeanOperationInfo[] opInfo = getWrappedOperationInfo(pMBeanInfo); return new MBeanInfo(pMBeanInfo.getClassName(), pMBeanInfo.getDescription(), attrInfo, null, /* We dont allow construction of this MBean, hence null-constructors */ opInfo, pMBeanInfo.getNotifications() ); }
@Override public MBeanInfo getMBeanInfo() { MBeanInfo info = super.getMBeanInfo(); return new MBeanInfo(info.getClassName(), info.getDescription(), info.getAttributes(), info.getConstructors(), MBeanInfoHelper.getMBeanOperationsInfo(JMSQueueControl.class), info.getNotifications()); }
@Override public MBeanInfo getMBeanInfo() { MBeanInfo info = super.getMBeanInfo(); return new MBeanInfo(info.getClassName(), info.getDescription(), info.getAttributes(), info.getConstructors(), MBeanInfoHelper.getMBeanOperationsInfo(ConnectionFactoryControl.class), info.getNotifications()); }
@Override protected synchronized void cacheMBeanInfo(MBeanInfo info) { if (info != null && info.getNotifications().length == 0) { MBeanNotificationInfo[] notificationInfo = ((NotificationBroadcaster) mbeanImplementation).getNotificationInfo(); super.cacheMBeanInfo(new MBeanInfo(info.getClassName(), info.getDescription(), info.getAttributes(), info.getConstructors(), info.getOperations(), notificationInfo)); } else { super.cacheMBeanInfo(info); } }
@Override public MBeanInfo getMBeanInfo() { MBeanInfo info = super.getMBeanInfo(); return new MBeanInfo(info.getClassName(), info.getDescription(), fillMBeanAttributeInfo(), info.getConstructors(), fillMBeanOperationInfo(), info.getNotifications()); }
public void serialize(QName name, Attributes attributes, Object value, SerializationContext context) throws IOException { MBeanInfo info = (MBeanInfo)value; context.startElement(name, attributes); context.serialize(CLASS_NAME_QNAME, null, info.getClassName()); context.serialize(DESCRIPTION_QNAME, null, info.getDescription()); context.serialize(ATTRIBUTES_QNAME, null, info.getAttributes()); context.serialize(CONSTRUCTORS_QNAME, null, info.getConstructors()); context.serialize(OPERATIONS_QNAME, null, info.getOperations()); context.serialize(NOTIFICATIONS_QNAME, null, info.getNotifications()); context.endElement(); }