Example usage for javax.management MBeanNotificationInfo getName

List of usage examples for javax.management MBeanNotificationInfo getName

Introduction

In this page you can find the example usage for javax.management MBeanNotificationInfo getName.

Prototype

public String getName() 

Source Link

Document

Returns the name of the feature.

Usage

From source file:org.jolokia.handler.list.NotificationDataUpdater.java

/** {@inheritDoc} */
@Override//w w  w  .jav a  2 s .c om
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;
}

From source file:flens.query.JMXQuery.java

private Map<String, Object> getNotifications(MBeanInfo info) {
    Map<String, Object> outc = new HashMap<>();
    MBeanNotificationInfo[] atts = info.getNotifications();
    for (MBeanNotificationInfo att : atts) {
        Map<String, Object> out = new HashMap<>();
        outc.put(att.getName(), out);
        out.put("description", att.getDescription());
        out.put("type", att.getNotifTypes());
    }/* ww w. java 2s . c om*/
    return outc;
}

From source file:org.mc4j.ems.impl.jmx.connection.bean.DMBean.java

public synchronized void loadSynchronous() {
    if (!loaded) {
        try {//ww w.jav  a  2s. c o  m
            info = connectionProvider.getMBeanServer().getMBeanInfo(this.objectName);

            if (info.getAttributes().length > 0) {

                this.attributes = new TreeMap<String, EmsAttribute>(String.CASE_INSENSITIVE_ORDER);
                for (MBeanAttributeInfo attributeInfo : info.getAttributes()) {
                    DAttribute attribute = new DAttribute(attributeInfo, this);
                    this.attributes.put(attributeInfo.getName(), attribute);
                }
            }

            if (info.getOperations().length > 0) {
                this.operations = new TreeMap<String, EmsOperation>(String.CASE_INSENSITIVE_ORDER);
                for (MBeanOperationInfo operationInfo : info.getOperations()) {
                    DOperation operation = new DOperation(operationInfo, this);
                    this.operations.put(operationInfo.getName(), operation);
                }
            }

            if (info.getNotifications().length > 0) {
                this.notifications = new TreeMap<String, EmsNotification>(String.CASE_INSENSITIVE_ORDER);
                for (MBeanNotificationInfo notificationInfo : info.getNotifications()) {
                    DNotification notification = new DNotification(notificationInfo, this);
                    this.notifications.put(notificationInfo.getName(), notification);
                }
            }

        } catch (InstanceNotFoundException infe) {
            this.deleted = true;
            this.attributes = null;
            this.operations = null;
            this.notifications = null;

        } catch (Exception e) {
            unsupportedType = true;
            RuntimeException f = new EmsUnsupportedTypeException(
                    "Could not load MBean info, unsupported type on bean " + objectName, e);
            // TODO: Memory Leak below... don't do that
            //registerFailure(f);
            // TODO should we throw this here?
            //throw f;
        } finally {
            loaded = true;
        }
    }
}