Package javax.management.openmbean

Examples of javax.management.openmbean.TabularData


        loggerLevels.put("a.b.C", TEST_LEVEL1);
        loggerLevels.put("a.b.c.E", TEST_LEVEL2);

        when(_mockLoggingFacade.retrieveRuntimeLoggersLevels()).thenReturn(loggerLevels );

        TabularData table = _loggingMBean.viewEffectiveRuntimeLoggerLevels();
        assertEquals(3, table.size());

        final CompositeData row1 = table.get(new String[] {"a.b.C"} );
        final CompositeData row2 = table.get(new String[] {"a.b.D"} );
        final CompositeData row3 = table.get(new String[] {"a.b.c.E"} );
        assertChannelRow(row1, "a.b.C", TEST_LEVEL1);
        assertChannelRow(row2, "a.b.D", TEST_LEVEL2);
        assertChannelRow(row3, "a.b.c.E", TEST_LEVEL2);
    }
View Full Code Here


        loggerLevels.put("a.b.C", TEST_LEVEL1);
        loggerLevels.put("a.b.c.E", "level2");

        when(_mockLoggingFacade.retrieveConfigFileLoggersLevels()).thenReturn(loggerLevels );

        TabularData table = _loggingMBean.viewConfigFileLoggerLevels();
        assertEquals(3, table.size());

        final CompositeData row1 = table.get(new String[] {"a.b.C"} );
        final CompositeData row2 = table.get(new String[] {"a.b.D"} );
        final CompositeData row3 = table.get(new String[] {"a.b.c.E"} );
        assertChannelRow(row1, "a.b.C", TEST_LEVEL1);
        assertChannelRow(row2, "a.b.D", TEST_LEVEL2);
        assertChannelRow(row3, "a.b.c.E", TEST_LEVEL2);
    }
View Full Code Here

    public void testGroupMembersForGroupWithOneNode() throws Exception
    {
        List<Map<String, String>> members = Collections.singletonList(createTestNodeResult());
        when(_store.getGroupMembers()).thenReturn(members);

        final TabularData resultsTable = _mBean.getAllNodesInGroup();

        assertTableHasHeadingsNamed(resultsTable, BDBHAMessageStore.GRP_MEM_COL_NODE_NAME, BDBHAMessageStore.GRP_MEM_COL_NODE_HOST_PORT);

        final int numberOfDataRows = resultsTable.size();
        assertEquals("Unexpected number of data rows", 1 ,numberOfDataRows);
        final CompositeData row = (CompositeData) resultsTable.values().iterator().next();
        assertEquals(TEST_NODE_NAME, row.get(BDBHAMessageStore.GRP_MEM_COL_NODE_NAME));
        assertEquals(TEST_NODE_HOST_PORT, row.get(BDBHAMessageStore.GRP_MEM_COL_NODE_HOST_PORT));
    }
View Full Code Here

    public void testGroupMembers() throws Exception
    {
        final int brokerPortNumber = getBrokerPortNumbers().iterator().next();

        ManagedBDBHAMessageStore storeBean = getStoreBeanForNodeAtBrokerPort(brokerPortNumber);
        final TabularData groupMembers = storeBean.getAllNodesInGroup();
        assertNotNull(groupMembers);

        final int numberOfDataRows = groupMembers.size();
        assertEquals("Unexpected number of data rows", NUMBER_OF_NODES ,numberOfDataRows);

        for(int bdbPortNumber : _clusterCreator.getBdbPortNumbers())
        {
            final String nodeName = _clusterCreator.getNodeNameForNodeAt(bdbPortNumber);
            final String nodeHostPort = _clusterCreator.getNodeHostPortForNodeAt(bdbPortNumber);

            CompositeData row = groupMembers.get(new Object[] {nodeName});
            assertNotNull("Table does not contain row for node name " + nodeName, row);
            assertEquals(nodeHostPort, row.get(BDBHAMessageStore.GRP_MEM_COL_NODE_HOST_PORT));
        }
    }
View Full Code Here

        List<Instance> allInstances = Arrays.asList(adminService.getInstances());
        List<JmxInstance> instances = new ArrayList<JmxInstance>();
        for (Instance instance : allInstances) {
            instances.add(new JmxInstance(instance));
        }
        TabularData table = JmxInstance.tableFrom(instances);
        return table;
    }
View Full Code Here

                    features.add(new JmxFeature(feature, insFeatures.contains(feature)));
                } catch (Throwable t) {
                    t.printStackTrace();
                }
            }
            TabularData table = JmxFeature.tableFrom(features);
            return table;
        } catch (Throwable t) {
            t.printStackTrace();
            return null;
        }
View Full Code Here

            List<Repository> allRepositories = Arrays.asList(featuresService.listRepositories());
            ArrayList<JmxRepository> repositories = new ArrayList<JmxRepository>();
            for (Repository repository : allRepositories) {
                repositories.add(new JmxRepository(repository));
            }
            TabularData table = JmxRepository.tableFrom(repositories);
            return table;
        } catch (Throwable t) {
            t.printStackTrace();
            return null;
        }
View Full Code Here

                instances.add(new JmxInstance(instance));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        TabularData table = JmxInstance.tableFrom(instances);
        return table;
    }
View Full Code Here

public class TabularDataControlFactory extends AbstractTabularControlFactory {

  @Override
  @SuppressWarnings("unchecked")//$NON-NLS-1$
  protected void fillTable(final Table table, final Object value) {
    TabularData data = (TabularData) value;
   
    Set keySet = data.getTabularType().getRowType().keySet();
   
        for (Object o : keySet) {
            TableColumn column = new TableColumn(table, SWT.LEFT);
            column.setText((String) o);
            column.setWidth(150);
            column.setMoveable(true);
            column.setResizable(true);
        }
       
        for (Object o : data.values()) {
            CompositeData rowData = (CompositeData) o;
            TableItem item = new TableItem(table, SWT.NONE);

            int i = 0;
            for (Object o2 : keySet) {
View Full Code Here

    }

    public Collection<JobFacade> getScheduledJobs() throws Exception {
        JobSchedulerViewMBean jobScheduler = getJobScheduler();
        List<JobFacade> result = new ArrayList<JobFacade>();
        TabularData table = jobScheduler.getAllJobs();
        for (Object object : table.values()) {
            CompositeData cd = (CompositeData) object;
            JobFacade jf = new JobFacade(cd);
            result.add(jf);
        }
        return result;
View Full Code Here

TOP

Related Classes of javax.management.openmbean.TabularData

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.