Package javax.management.openmbean

Examples of javax.management.openmbean.TabularData


    private void printCompactionHistory(PrintStream out)
    {
        out.println("Compaction History: ");

        TabularData tabularData = this.probe.getCompactionHistory();
        if (tabularData.isEmpty())
        {
            out.printf("There is no compaction history");
            return;
        }

        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


    }

    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

            }
            messageIDs[i] = (String)cdata.get("JMSMessageID");
            echo("message " + i + " : " + cdata.values());
        }

        TabularData table = proxy.browseAsTable();
        echo("Found tabular data: " + table);
        assertTrue("Table should not be empty!", table.size() > 0);

        assertEquals("Queue size", MESSAGE_COUNT, proxy.getQueueSize());

        String messageID = messageIDs[0];
        String newDestinationName = "queue://dummy.test.cheese";
View Full Code Here

    }

    private void awaitBootstrapCompleteService(String serviceName, long timeout, TimeUnit unit) throws TimeoutException, InterruptedException, IOException {
        long timeoutMillis = System.currentTimeMillis() + unit.toMillis(timeout);
        while (System.currentTimeMillis() < timeoutMillis) {
            TabularData list = serviceStateMBean.listServices(serviceName, null);
            if (list.size() > 0) {
                return;
            } else {
                Thread.sleep(500);
            }
        }
View Full Code Here

        return handle;
    }

    private List<BundleHandle> listBundles(String symbolicName) throws IOException {
        List<BundleHandle> bundleList = new ArrayList<BundleHandle>();
        TabularData listBundles = bundleStateMBean.listBundles();
        Iterator<?> iterator = listBundles.values().iterator();
        while (iterator.hasNext()) {
            CompositeData bundleType = (CompositeData) iterator.next();
            Long bundleId = (Long) bundleType.get(BundleStateMBean.IDENTIFIER);
            String auxName = (String) bundleType.get(BundleStateMBean.SYMBOLIC_NAME);
            if (symbolicName == null || symbolicName.equals(auxName)) {
View Full Code Here

        final Message sentMessage = sentMessages.get(0);

        assertEquals("Unexpected queue depth", 1, _managedSourceQueue.getMessageCount().intValue());

        // Check the contents of the message
        final TabularData tab = _managedSourceQueue.viewMessages(1l, 1l);
        assertEquals("Unexpected number of rows in table", 1, tab.size());
        final Iterator<CompositeData> rowItr = (Iterator<CompositeData>) tab.values().iterator();

        final CompositeData row1 = rowItr.next();
        assertNotNull("Message should have AMQ message id", row1.get(ManagedQueue.MSG_AMQ_ID));
        assertEquals("Unexpected queue position", 1l, row1.get(ManagedQueue.MSG_QUEUE_POS));
        assertEquals("Unexpected redelivered flag", Boolean.FALSE, row1.get(ManagedQueue.MSG_REDELIVERED));
View Full Code Here

    private List<Long> getAMQMessageIdsOn(ManagedQueue managedQueue, long startIndex, long endIndex) throws Exception
    {
        final SortedSet<Long> messageIds = new TreeSet<Long>();

        final TabularData tab = managedQueue.viewMessages(startIndex, endIndex);
        final Iterator<CompositeData> rowItr = (Iterator<CompositeData>) tab.values().iterator();
        while(rowItr.hasNext())
        {
            final CompositeData row = rowItr.next();
            long amqMessageId = (Long)row.get(ManagedQueue.MSG_AMQ_ID);
            messageIds.add(amqMessageId);
View Full Code Here

    Statistics statistics = getStatistics();
    for ( String entity : statistics.getEntityNames() ) {
      EntityStats entityStats = new EntityStats( entity, statistics.getEntityStatistics( entity ) );
      result.add( entityStats.toCompositeData() );
    }
    TabularData td = EntityStats.newTabularDataInstance();
    td.putAll( result.toArray( new CompositeData[result.size()] ) );
    return td;
  }
View Full Code Here

          roleName,
          statistics.getCollectionStatistics( roleName )
      );
      result.add( collectionStats.toCompositeData() );
    }
    TabularData td = CollectionStats.newTabularDataInstance();
    td.putAll( result.toArray( new CompositeData[result.size()] ) );
    return td;
  }
View Full Code Here

    Statistics statistics = getStatistics();
    for ( String query : statistics.getQueries() ) {
      QueryStats queryStats = new QueryStats( query, statistics.getQueryStatistics( query ) );
      result.add( queryStats.toCompositeData() );
    }
    TabularData td = QueryStats.newTabularDataInstance();
    td.putAll( result.toArray( new CompositeData[result.size()] ) );
    return td;
  }
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.