Modifier and Type | Class and Description |
---|---|
static interface |
JSONBean.Writer
Use dumping out mbeans as JSON.
|
Modifier and Type | Field and Description |
---|---|
private static String |
ASTERICK |
private static String |
COMMA |
private static org.apache.hbase.thirdparty.com.google.gson.Gson |
GSON |
private static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
JSONBean() |
Modifier and Type | Method and Description |
---|---|
static void |
dumpAllBeans()
Dump out all registered mbeans as json on System.out.
|
JSONBean.Writer |
open(PrintWriter writer)
Notice that, closing the return
JSONBean.Writer will not close the writer passed in, you
still need to close the writer by yourself. |
private static int |
write(org.apache.hbase.thirdparty.com.google.gson.stream.JsonWriter writer,
MBeanServer mBeanServer,
ObjectName qry,
String attribute,
boolean description)
Returns Return non-zero if failed to find bean.
|
private static void |
writeAttribute(org.apache.hbase.thirdparty.com.google.gson.stream.JsonWriter writer,
MBeanServer mBeanServer,
ObjectName oname,
boolean description,
Pattern[] pattern,
MBeanAttributeInfo attr) |
private static void |
writeAttribute(org.apache.hbase.thirdparty.com.google.gson.stream.JsonWriter writer,
String attName,
String descriptionStr,
Object value) |
private static void |
writeObject(org.apache.hbase.thirdparty.com.google.gson.stream.JsonWriter writer,
Object value) |
private static final String COMMA
private static final String ASTERICK
private static final org.slf4j.Logger LOG
private static final org.apache.hbase.thirdparty.com.google.gson.Gson GSON
public JSONBean()
public JSONBean.Writer open(PrintWriter writer) throws IOException
JSONBean.Writer
will not close the writer
passed in, you
still need to close the writer
by yourself.
This is because that, we can only finish the json after you call Closeable.close()
. So if
we just close the writer
, you can write nothing after finished the json.IOException
private static int write(org.apache.hbase.thirdparty.com.google.gson.stream.JsonWriter writer, MBeanServer mBeanServer, ObjectName qry, String attribute, boolean description) throws IOException
IOException
private static void writeAttribute(org.apache.hbase.thirdparty.com.google.gson.stream.JsonWriter writer, MBeanServer mBeanServer, ObjectName oname, boolean description, Pattern[] pattern, MBeanAttributeInfo attr) throws IOException
IOException
private static void writeAttribute(org.apache.hbase.thirdparty.com.google.gson.stream.JsonWriter writer, String attName, String descriptionStr, Object value) throws IOException
IOException
private static void writeObject(org.apache.hbase.thirdparty.com.google.gson.stream.JsonWriter writer, Object value) throws IOException
IOException
public static void dumpAllBeans() throws IOException, MalformedObjectNameException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.