Package javax.management.openmbean

Examples of javax.management.openmbean.TabularData.keySet()


        EasyMock.expect(i.getJavaOpts()).andReturn("someopts");
        EasyMock.replay(i);
       
        JmxInstance ji = new JmxInstance(i);
        TabularData td = JmxInstance.tableFrom(Collections.singletonList(ji));       
        Collection<?> keys = (Collection<?>) td.keySet().iterator().next();
        Assert.assertEquals("MyInstance", keys.iterator().next());
       
        CompositeData cd = td.get(keys.toArray());
        Assert.assertEquals(1712, cd.get("Pid"));
        Assert.assertEquals("MyInstance", cd.get("Name"));
View Full Code Here


        EasyMock.expect(i.getJavaOpts()).andReturn(null);
        EasyMock.replay(i);
       
        JmxInstance ji = new JmxInstance(i);
        TabularData td = JmxInstance.tableFrom(Collections.singletonList(ji));       
        Collection<?> keys = (Collection<?>) td.keySet().iterator().next();
        Assert.assertEquals("MyInstance", keys.iterator().next());
       
        CompositeData cd = td.get(keys.toArray());
        Assert.assertEquals(1712, cd.get("Pid"));
        Assert.assertEquals("MyInstance", cd.get("Name"));
View Full Code Here

            }

            if (TabularData.class.isInstance(value)) {
                final TabularData td = TabularData.class.cast(value);
                final StringBuilder builder = new StringBuilder().append("<table class=\"table table-condensed\">");
                for (final Object type : td.keySet()) {
                    final List<?> values = (List<?>) type;
                    final CompositeData data = td.get(values.toArray(new Object[values.size()]));
                    builder.append("<tr>");
                    final Set<String> dataKeys = data.getCompositeType().keySet();
                    for (final String k : data.getCompositeType().keySet()) {
View Full Code Here

            String format = "%-41s%-19s%-29s%-26s%-15s%-15s%s%n";
            List<String> indexNames = tabularData.getTabularType().getIndexNames();
            System.out.printf(format, toArray(indexNames, Object.class));

            Set<?> values = tabularData.keySet();
            for (Object eachValue : values)
            {
                List<?> value = (List<?>) eachValue;
                System.out.printf(format, toArray(value, Object.class));
            }
View Full Code Here

            String format = "%-41s%-19s%-29s%-26s%-15s%-15s%s%n";
            List<String> indexNames = tabularData.getTabularType().getIndexNames();
            System.out.printf(format, toArray(indexNames, Object.class));

            Set<?> values = tabularData.keySet();
            for (Object eachValue : values)
            {
                List<?> value = (List<?>) eachValue;
                System.out.printf(format, toArray(value, Object.class));
            }
View Full Code Here

     *
     * @param depth current recursion depth
     */
  private static void dumpTabularData(String lead, Object obj, StringBuilder sb, int depth) {
    TabularData td = (TabularData)obj;
    for (Object ksObj : td.keySet()) {
      sb.append(lead);
      dump(lead + LEAD, ksObj, sb, depth + 1);
      sb.append("\n");
    }
  }
View Full Code Here

        String format = "%-41s%-19s%-29s%-26s%-15s%-15s%s%n";
        List<String> indexNames = tabularData.getTabularType().getIndexNames();
        out.printf(format, (Object[]) indexNames.toArray(new String[indexNames.size()]));

        Set<?> values = tabularData.keySet();
        for (Object eachValue : values)
        {
            List<?> value = (List<?>) eachValue;
            out.printf(format, value.toArray(new Object[value.size()]));
        }
View Full Code Here

        EasyMock.expect(i.getLocation()).andReturn("somewhere");
        EasyMock.replay(i);
       
        JmxInstance ji = new JmxInstance(i);
        TabularData td = JmxInstance.tableFrom(Collections.singletonList(ji));       
        Collection<?> keys = (Collection<?>) td.keySet().iterator().next();
        Assert.assertEquals("MyInstance", keys.iterator().next());
       
        CompositeData cd = td.get(keys.toArray());
        Assert.assertEquals(1712, cd.get("Pid"));
        Assert.assertEquals("MyInstance", cd.get("Name"));
View Full Code Here

        EasyMock.expect(i.getLocation()).andReturn(null);
        EasyMock.replay(i);
       
        JmxInstance ji = new JmxInstance(i);
        TabularData td = JmxInstance.tableFrom(Collections.singletonList(ji));       
        Collection<?> keys = (Collection<?>) td.keySet().iterator().next();
        Assert.assertEquals("MyInstance", keys.iterator().next());
       
        CompositeData cd = td.get(keys.toArray());
        Assert.assertEquals(1712, cd.get("Pid"));
        Assert.assertEquals("MyInstance", cd.get("Name"));
View Full Code Here

            String format = "%-41s%-19s%-29s%-26s%-15s%-15s%s%n";
            List<String> indexNames = tabularData.getTabularType().getIndexNames();
            System.out.printf(format, toArray(indexNames, Object.class));

            Set<?> values = tabularData.keySet();
            for (Object eachValue : values)
            {
                List<?> value = (List<?>) eachValue;
                System.out.printf(format, toArray(value, Object.class));
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.