Package javax.management.openmbean

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


        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

        jobParams.put("jobClass", data.get("jobClass"));
        jobParams.put("durability", data.get("durability"));
        jobParams.put("shouldRecover", data.get("shouldRecover"));
        // JMX API with TabularData and CompositeData is cluttered to use
        TabularData tJobDataMap = (TabularData) data.get("jobDataMap");
        for (Object cKey : tJobDataMap.keySet()) {
            Object key = ((List) cKey).get(0);
            Object value = tJobDataMap.get(new Object[]{key});
            if (value != null) {
                CompositeData cd = (CompositeData) value;
                Iterator it = cd.values().iterator();
View Full Code Here

        assertEquals(100, averageTime.longValue());

        // check table (populated  case)
        table = (TabularData) openMBean.getAttribute("statisticsTable");
        assertFalse(table.isEmpty());
        assertEquals(1, table.keySet().size());

        CompositeData data = table.get(new Object[]{"foo"});
        assertNotNull(data);
        String[] columnNames = new String[]{"methodName", "callCount", "totalTime", "avgTime"};
        Object[] columnValues = data.getAll(columnNames);
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.