Example usage for javax.management MBeanParameterInfo getDescription

List of usage examples for javax.management MBeanParameterInfo getDescription

Introduction

In this page you can find the example usage for javax.management MBeanParameterInfo getDescription.

Prototype

public String getDescription() 

Source Link

Document

Returns the human-readable description of the feature.

Usage

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

/** {@inheritDoc} */
@Override//w  w  w  . j  av a2 s . c o m
protected JSONObject extractData(MBeanInfo pMBeanInfo, String pOperation) {
    JSONObject opMap = new JSONObject();

    for (MBeanOperationInfo opInfo : pMBeanInfo.getOperations()) {
        if (pOperation == null || opInfo.getName().equals(pOperation)) {
            JSONObject map = new JSONObject();
            JSONArray argList = new JSONArray();
            for (MBeanParameterInfo paramInfo : opInfo.getSignature()) {
                JSONObject args = new JSONObject();
                args.put(DESCRIPTION.getKey(), paramInfo.getDescription());
                args.put(NAME.getKey(), paramInfo.getName());
                args.put(TYPE.getKey(), paramInfo.getType());
                argList.add(args);
            }
            map.put(ARGS.getKey(), argList);
            map.put(RETURN_TYPE.getKey(), opInfo.getReturnType());
            map.put(DESCRIPTION.getKey(), opInfo.getDescription());
            Object ops = opMap.get(opInfo.getName());
            if (ops != null) {
                if (ops instanceof List) {
                    // If it is already a list, simply add it to the end
                    ((List) ops).add(map);
                } else if (ops instanceof Map) {
                    // If it is a map, add a list with two elements
                    // (the old one and the new one)
                    JSONArray opList = new JSONArray();
                    opList.add(ops);
                    opList.add(map);
                    opMap.put(opInfo.getName(), opList);
                } else {
                    throw new IllegalArgumentException(
                            "Internal: list, addOperations: Expected Map or List, not " + ops.getClass());
                }
            } else {
                // No value set yet, simply add the map as plain value
                opMap.put(opInfo.getName(), map);
            }
        }
    }
    return opMap;
}

From source file:flens.query.JMXQuery.java

@SuppressWarnings({ "rawtypes", "unchecked" })
private List getSig(MBeanParameterInfo[] signature) {
    List outc = new LinkedList<>();

    for (MBeanParameterInfo att : signature) {
        Map<String, Object> out = new HashMap<>();
        outc.add(out);/*from ww w.  j a va2s.c  o m*/
        out.put("name", att.getName());
        out.put("description", att.getDescription());
        out.put("type", att.getType());
    }
    return outc;
}