code: public void addMBeanInfo(MBeanInfo mBeanInfo, ObjectName pName)
              throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException {
  
          JSONObject mBeansMap = getOrCreateJSONObject(infoMap, pName.getDomain());
          JSONObject mBeanMap = getOrCreateJSONObject(mBeansMap, getKeyPropertyString(pName));
          // Trim down stack to get rid of domain/property list
          Stack<String> stack = truncatePathStack(2);
          if (stack.empty()) {
              addFullMBeanInfo(mBeanMap, mBeanInfo);
          } else {
              addPartialMBeanInfo(mBeanMap, mBeanInfo,stack);
          }
          // Trim if required
          if (mBeanMap.size() == 0) {
              mBeansMap.remove(getKeyPropertyString(pName));
              if (mBeansMap.size() == 0) {
                  infoMap.remove(pName.getDomain());
              }
          }
      }
docs: Add information about an MBean as obtained from an {@link MBeanInfo} descriptor. The information added
  can be restricted by a given path (which has already be prepared as a stack). Also, a max depth as given in the
  constructor restricts the size of the map from the top.
  
  @param mBeanInfo the MBean info
  @param pName the object name of the MBean