Package com.jitlogic.zorka.common.util

Examples of com.jitlogic.zorka.common.util.JmxObject


    }


    @Test
    public void testInspectJmxObj() throws Exception {
        JmxObject jmxObject = mkJmxObject();

        assertEquals(100L, ObjectInspector.get(jmxObject, "Nom"));
    }
View Full Code Here


    }


    @Test
    public void testListJmxObj() throws Exception {
        JmxObject jmxObject = mkJmxObject();

        assertEquals(Arrays.asList("Div", "Nom", "StrMap"), ObjectInspector.list(jmxObject));
    }
View Full Code Here

        TestJmx bean = new TestJmx();
        bean.setNom(100);
        bean.setDiv(200);
        ObjectName on = new ObjectName("zorka.test:name=test");
        testMbs.registerMBean(bean, on);
        return new JmxObject(on, testMbs, null);
    }
View Full Code Here

    private void getSingleResult(MBeanServerConnection conn, QuerySegment seg, List<QueryResult> results, ObjectName on) {
        try {
            makeResult(seg, results, on, seg != null
                    ? conn.getAttribute(on, seg.getAttr().toString())
                    : new JmxObject(on, conn, null),
                    seg != null ? seg.getAttr() : null);
        } catch (Exception e) {
            log.error(ZorkaLogger.ZAG_ERRORS, "Error listing results of " + query, e);
        }
    }
View Full Code Here

     * @param sb output string buffer
     *
     * @param depth current recursion depth
     */
  private static void dumpJmxObject(String lead, Object obj, StringBuilder sb, int depth) {
    JmxObject jmx = (JmxObject)obj;
    sb.append(jmx.getName()); sb.append(":\n");
    try {
      MBeanInfo mi = jmx.getConn().getMBeanInfo(jmx.getName());
      for (MBeanAttributeInfo mbi : mi.getAttributes()) {
        try {
          Object o = jmx.getConn().getAttribute(jmx.getName(), mbi.getName());
          sb.append(lead);
                    sb.append(mbi.getName());
                    sb.append(" : ");
          sb.append(mbi.getType());
                    sb.append(" = ");
View Full Code Here

TOP

Related Classes of com.jitlogic.zorka.common.util.JmxObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.