Package javax.management.openmbean

Examples of javax.management.openmbean.CompositeData


  return (cds);
    }

    public CompositeData getTransactionInfoByID(String transactionID) throws MBeanException  {
  CompositeData cd = null;

  try  {
      cd = TransactionUtil.getTransactionInfo(transactionID);
  } catch(Exception e)  {
      handleOperationException(TransactionOperations.GET_TRANSACTION_INFO_BY_ID, e);
View Full Code Here


            String[] consumerIDs = (String[]) connection.invoke(exchangeManagerName, "getConsumerIDs", null, null);
            if(consumerIDs != null) {
                for(String consumerID : consumerIDs) {
                    if(consumerID != null) {
                        try {
                            CompositeData info = (CompositeData) connection.invoke(consumerManagerName, "getConsumerInfoByID", new Object[] {
                                consumerID
                            }, MBEAN_INVOKE_SIG);
                            if(info != null) {
                                metric.addConsumer(info.get("Host").toString());
                            }
                        }
                        catch(Exception e) {
                            logger.warn("cannot get info of consumer ID {}", consumerID);
                        }
                    }
                }
            }

            String[] producerIDs = (String[]) connection.invoke(exchangeManagerName, "getProducerIDs", null, null);
            if(producerIDs != null) {
                for(String producerID : producerIDs) {
                    if(producerID != null) {
                        try {
                            CompositeData info = (CompositeData) connection.invoke(producerManagerName, "getProducerInfoByID", new Object[] {
                                producerID
                            }, MBEAN_INVOKE_SIG);
                            if(info != null) {
                                metric.addProducer(info.get("Host").toString());
                            }
                        }
                        catch(Exception e) {
                            logger.warn("cannot get info of producer ID {}", producerID);
                        }
View Full Code Here

  public Object getValueAt(int row, int column) {
    if ((clusterInfo == null) || (clusterInfo.length == 0)) {
      return ("");
    }

    CompositeData info = clusterInfo[row];

    switch (column) {

    case 0:
      // only set for HA clusters, otherwise null
      return (info.get(BrokerClusterInfo.ID));

    case 1:
      return (info.get(BrokerClusterInfo.ADDRESS));

    case 2:
      return (BrokerState.toString(((Integer) info.get(BrokerClusterInfo.STATE)).intValue()));

    case 3:
      Object numMsgsObj = info.get(BrokerClusterInfo.NUM_MSGS);
      // only set for HA clusters, otherwise null
      if (numMsgsObj != null) {
        return numMsgsObj.toString();
      } else {
        return "";
      }
      // return ((info.get(BrokerClusterInfo.NUM_MSGS)).toString());

    case 4:
      // only set for HA clusters, otherwise null
      return (info.get(BrokerClusterInfo.TAKEOVER_BROKER_ID));

    case 5:
      // only set for HA clusters, otherwise null
      Long statusTimestampObj = (Long) info.get(BrokerClusterInfo.STATUS_TIMESTAMP);
      if (statusTimestampObj != null) {
        long tmpLong = ((Long) info.get(BrokerClusterInfo.STATUS_TIMESTAMP)).longValue();
        long idle = System.currentTimeMillis() - tmpLong;
        return (getTimeString(idle));
      } else {
        return "";
      }
View Full Code Here

  public int getBrokerState(int row) {
    if ((clusterInfo == null) || (clusterInfo.length == 0)) {
      return (BrokerState.BROKER_DOWN);
    }

    CompositeData info = clusterInfo[row];

    if (info == null) {
      return (BrokerState.BROKER_DOWN);
    }

    int state = ((Integer) info.get(BrokerClusterInfo.STATE)).intValue();

    return (state);
  }
View Full Code Here

    }
  }

  public void load() {
    try {
      CompositeData cd[] = (CompositeData[]) mbsc.invoke(clsMon, ClusterOperations.GET_BROKER_INFO, null, null);

      ClusterTableModel m = (ClusterTableModel) clsTable.getModel();
      m.load(cd);
    } catch (Exception e) {
      addStatusText("Exception caught while reloading data: " + e);
View Full Code Here

                "spill.size.threshold, spill.gc.activation.size", nfe) ;
        }
    }
   
    public void handleNotification(Notification n, Object o) {
        CompositeData cd = (CompositeData) n.getUserData();
        MemoryNotificationInfo info = MemoryNotificationInfo.from(cd);
       
        // free the amount exceeded over the threshold and then a further half
        // so if threshold = heapmax/2, we will be trying to free
        // used - heapmax/2 + heapmax/4
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

            CompositeData[] compositeData = (CompositeData[]) mBeanServer.invoke(objectInstance.getObjectName(), "browse", new Object[] { selector }, new String[] { String.class.getName() });
            if (compositeData.length > 0) {
                JMSMessageInfo[] messageInfos = new JMSMessageInfo[compositeData.length];
                for (int i = 0; i < compositeData.length; i++) {
                    JMSMessageInfo jmsMessageInfo = new JMSMessageInfo();
                    CompositeData data = compositeData[i];
                    if (compositeData[0].getCompositeType().getTypeName().equals("org.apache.activemq.command.ActiveMQTextMessage")) {
                        jmsMessageInfo.setMessage((String) data.get(CompositeDataConstants.MESSAGE_TEXT));
                    } else {
                        jmsMessageInfo.setMessage("Only Text Messages will be displayed..");
                    }
                    jmsMessageInfo.setPriority((Integer) data.get("JMSPriority"));
                    jmsMessageInfo.setMessageId((String) data.get("JMSMessageID"));
                    jmsMessageInfo.setDestination((String) data.get("JMSDestination"));
                    jmsMessageInfo.setTimeStamp(((Date) data.get("JMSTimestamp")).getTime());
                    jmsMessageInfo.setExpiration((Long) data.get("JMSExpiration"));
                    jmsMessageInfo.setJmsType((String) data.get("JMSType"));
                    jmsMessageInfo.setReplyTo((String) data.get("JMSReplyTo"));
                    jmsMessageInfo.setCorrelationId((String) data.get("JMSCorrelationID"));
                    messageInfos[i] = jmsMessageInfo;
                }
                return messageInfos;
            }
            return new JMSMessageInfo[0];
View Full Code Here

        }
    }

    public CompositeData[] browse(SubscriptionView view) throws OpenDataException {
        List<Message> messages = getSubscriberMessages(view);
        CompositeData c[] = new CompositeData[messages.size()];
        for (int i = 0; i < c.length; i++) {
            try {
                c[i] = OpenTypeSupport.convert(messages.get(i));
            } catch (Throwable e) {
                LOG.error("failed to browse : " + view, e);
View Full Code Here

            echo("Current queue size: " + initialQueueSize);
        }
        int messageCount = initialQueueSize;
        String[] messageIDs = new String[messageCount];
        for (int i = 0; i < messageCount; i++) {
            CompositeData cdata = compdatalist[i];
            String messageID = (String) cdata.get("JMSMessageID");
            assertNotNull("Should have a message ID for message " + i, messageID);
            messageIDs[i] = messageID;
        }

        assertTrue("dest has some memory usage", queue.getMemoryPercentUsage() > 0);
View Full Code Here

TOP

Related Classes of javax.management.openmbean.CompositeData

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.