code: public Map<String, Object> getMBeanResult(final String mbeanName) {
      final Map<String, Object> ret = new HashMap<>();
      try {
        final ObjectName name = new ObjectName(mbeanName);
        final MBeanInfo info = getMBeanInfo(name);
  
        final MBeanAttributeInfo[] mbeanAttrs = info.getAttributes();
        final Map<String, Object> attributes = new TreeMap<>();
  
        for (final MBeanAttributeInfo attrInfo : mbeanAttrs) {
          final Object obj = getMBeanAttribute(name, attrInfo.getName());
          attributes.put(attrInfo.getName(), obj);
        }
  
        ret.put("attributes", attributes);
      } catch (final Exception e) {
        logger.error("Invalid MBean Name. name = " + mbeanName, e);
        ret.put("error", "'" + mbeanName + "' is not a valid mBean name");
      }
  
      return ret;
    }
docs: Get MBean Result
  @param mbeanName mbeanName
  @return Map of MBean