Java 类org.apache.catalina.mbeans.MBeanDumper 实例源码

项目:tomcat7    文件:JMXProxyServlet.java   
public void listBeans( PrintWriter writer, String qry )
{

    Set<ObjectName> names = null;
    try {
        names=mBeanServer.queryNames(new ObjectName(qry), null);
        writer.println("OK - Number of results: " + names.size());
        writer.println();
    } catch (Exception ex) {
        writer.println("Error - " + ex.toString());
        ex.printStackTrace(writer);
        return;
    }

    String dump = MBeanDumper.dumpBeans(mBeanServer, names);
    writer.print(dump);
}
项目:apache-tomcat-7.0.73-with-comment    文件:JMXProxyServlet.java   
public void listBeans( PrintWriter writer, String qry )
{

    Set<ObjectName> names = null;
    try {
        names=mBeanServer.queryNames(new ObjectName(qry), null);
        writer.println("OK - Number of results: " + names.size());
        writer.println();
    } catch (Exception ex) {
        writer.println("Error - " + ex.toString());
        ex.printStackTrace(writer);
        return;
    }

    String dump = MBeanDumper.dumpBeans(mBeanServer, names);
    writer.print(dump);
}
项目:lazycat    文件:JMXProxyServlet.java   
public void listBeans(PrintWriter writer, String qry) {

        Set<ObjectName> names = null;
        try {
            names = mBeanServer.queryNames(new ObjectName(qry), null);
            writer.println("OK - Number of results: " + names.size());
            writer.println();
        } catch (Exception ex) {
            writer.println("Error - " + ex.toString());
            ex.printStackTrace(writer);
            return;
        }

        String dump = MBeanDumper.dumpBeans(mBeanServer, names);
        writer.print(dump);
    }
项目:class-guard    文件:JMXProxyServlet.java   
public void listBeans( PrintWriter writer, String qry )
{

    Set<ObjectName> names = null;
    try {
        names=mBeanServer.queryNames(new ObjectName(qry), null);
        writer.println("OK - Number of results: " + names.size());
        writer.println();
    } catch (Exception ex) {
        writer.println("Error - " + ex.toString());
        ex.printStackTrace(writer);
        return;
    }

    String dump = MBeanDumper.dumpBeans(mBeanServer, names);
    writer.print(dump);
}
项目:apache-tomcat-7.0.57    文件:JMXProxyServlet.java   
public void listBeans( PrintWriter writer, String qry )
{

    Set<ObjectName> names = null;
    try {
        names=mBeanServer.queryNames(new ObjectName(qry), null);
        writer.println("OK - Number of results: " + names.size());
        writer.println();
    } catch (Exception ex) {
        writer.println("Error - " + ex.toString());
        ex.printStackTrace(writer);
        return;
    }

    String dump = MBeanDumper.dumpBeans(mBeanServer, names);
    writer.print(dump);
}
项目:apache-tomcat-7.0.57    文件:JMXProxyServlet.java   
public void listBeans( PrintWriter writer, String qry )
{

    Set<ObjectName> names = null;
    try {
        names=mBeanServer.queryNames(new ObjectName(qry), null);
        writer.println("OK - Number of results: " + names.size());
        writer.println();
    } catch (Exception ex) {
        writer.println("Error - " + ex.toString());
        ex.printStackTrace(writer);
        return;
    }

    String dump = MBeanDumper.dumpBeans(mBeanServer, names);
    writer.print(dump);
}
项目:tomcat7    文件:JMXProxyServlet.java   
public void getAttribute(PrintWriter writer, String onameStr, String att, String key) {
    try {
        ObjectName oname = new ObjectName(onameStr);
        Object value = mBeanServer.getAttribute(oname, att);

        if(null != key && value instanceof CompositeData)
          value = ((CompositeData)value).get(key);

        String valueStr;
        if (value != null) {
            valueStr = value.toString();
        } else {
            valueStr = "<null>";
        }

        writer.print("OK - Attribute get '");
        writer.print(onameStr);
        writer.print("' - ");
        writer.print(att);

        if(null != key) {
            writer.print(" - key '");
            writer.print(key);
            writer.print("'");
        }

        writer.print(" = ");

        writer.println(MBeanDumper.escape(valueStr));
    } catch (Exception ex) {
        writer.println("Error - " + ex.toString());
        ex.printStackTrace(writer);
    }
}
项目:apache-tomcat-7.0.73-with-comment    文件:JMXProxyServlet.java   
public void getAttribute(PrintWriter writer, String onameStr, String att, String key) {
    try {
        ObjectName oname = new ObjectName(onameStr);
        Object value = mBeanServer.getAttribute(oname, att);

        if(null != key && value instanceof CompositeData)
          value = ((CompositeData)value).get(key);

        String valueStr;
        if (value != null) {
            valueStr = value.toString();
        } else {
            valueStr = "<null>";
        }

        writer.print("OK - Attribute get '");
        writer.print(onameStr);
        writer.print("' - ");
        writer.print(att);

        if(null != key) {
            writer.print(" - key '");
            writer.print(key);
            writer.print("'");
        }

        writer.print(" = ");

        writer.println(MBeanDumper.escape(valueStr));
    } catch (Exception ex) {
        writer.println("Error - " + ex.toString());
        ex.printStackTrace(writer);
    }
}
项目:lazycat    文件:JMXProxyServlet.java   
public void getAttribute(PrintWriter writer, String onameStr, String att, String key) {
    try {
        ObjectName oname = new ObjectName(onameStr);
        Object value = mBeanServer.getAttribute(oname, att);

        if (null != key && value instanceof CompositeData)
            value = ((CompositeData) value).get(key);

        String valueStr;
        if (value != null) {
            valueStr = value.toString();
        } else {
            valueStr = "<null>";
        }

        writer.print("OK - Attribute get '");
        writer.print(onameStr);
        writer.print("' - ");
        writer.print(att);

        if (null != key) {
            writer.print(" - key '");
            writer.print(key);
            writer.print("'");
        }

        writer.print(" = ");

        writer.println(MBeanDumper.escape(valueStr));
    } catch (Exception ex) {
        writer.println("Error - " + ex.toString());
        ex.printStackTrace(writer);
    }
}
项目:class-guard    文件:JMXProxyServlet.java   
public void getAttribute(PrintWriter writer, String onameStr, String att, String key) {
    try {
        ObjectName oname = new ObjectName(onameStr);
        Object value = mBeanServer.getAttribute(oname, att);

        if(null != key && value instanceof CompositeData)
          value = ((CompositeData)value).get(key);

        String valueStr;
        if (value != null) {
            valueStr = value.toString();
        } else {
            valueStr = "<null>";
        }

        writer.print("OK - Attribute get '");
        writer.print(onameStr);
        writer.print("' - ");
        writer.print(att);

        if(null != key) {
            writer.print(" - key '");
            writer.print(key);
            writer.print("'");
        }

        writer.print(" = ");

        writer.println(MBeanDumper.escape(valueStr));
    } catch (Exception ex) {
        writer.println("Error - " + ex.toString());
        ex.printStackTrace(writer);
    }
}
项目:apache-tomcat-7.0.57    文件:JMXProxyServlet.java   
public void getAttribute(PrintWriter writer, String onameStr, String att, String key) {
    try {
        ObjectName oname = new ObjectName(onameStr);
        Object value = mBeanServer.getAttribute(oname, att);

        if(null != key && value instanceof CompositeData)
          value = ((CompositeData)value).get(key);

        String valueStr;
        if (value != null) {
            valueStr = value.toString();
        } else {
            valueStr = "<null>";
        }

        writer.print("OK - Attribute get '");
        writer.print(onameStr);
        writer.print("' - ");
        writer.print(att);

        if(null != key) {
            writer.print(" - key '");
            writer.print(key);
            writer.print("'");
        }

        writer.print(" = ");

        writer.println(MBeanDumper.escape(valueStr));
    } catch (Exception ex) {
        writer.println("Error - " + ex.toString());
        ex.printStackTrace(writer);
    }
}
项目:apache-tomcat-7.0.57    文件:JMXProxyServlet.java   
public void getAttribute(PrintWriter writer, String onameStr, String att, String key) {
    try {
        ObjectName oname = new ObjectName(onameStr);
        Object value = mBeanServer.getAttribute(oname, att);

        if(null != key && value instanceof CompositeData)
          value = ((CompositeData)value).get(key);

        String valueStr;
        if (value != null) {
            valueStr = value.toString();
        } else {
            valueStr = "<null>";
        }

        writer.print("OK - Attribute get '");
        writer.print(onameStr);
        writer.print("' - ");
        writer.print(att);

        if(null != key) {
            writer.print(" - key '");
            writer.print(key);
            writer.print("'");
        }

        writer.print(" = ");

        writer.println(MBeanDumper.escape(valueStr));
    } catch (Exception ex) {
        writer.println("Error - " + ex.toString());
        ex.printStackTrace(writer);
    }
}