public static void dumpAllBeans() throws IOException, MalformedObjectNameException {
    try (PrintWriter writer =
      new PrintWriter(new OutputStreamWriter(System.out, StandardCharsets.UTF_8))) {
      JSONBean dumper = new JSONBean();
      try (JSONBean.Writer jsonBeanWriter = dumper.open(writer)) {
        MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();
        jsonBeanWriter.write(mbeanServer, new ObjectName("*:*"), null, false);
      }
    }
  }
Dump out all registered mbeans as json on System.out.
hbase-http/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java