Examples of queryMBeans()


Examples of javax.management.MBeanServer.queryMBeans()

                                    NotCompliantMBeanException,
                                    MalformedObjectNameException, ReflectionException,
                                    MBeanException, NullPointerException {
        MBeanServer server = ManagementFactory.getPlatformMBeanServer();
        System.out.println(server.getMBeanCount());
        for (Object object : server.queryMBeans(new ObjectName("*:*"), null))
            System.out.println(((ObjectInstance) object).getObjectName());

        ObjectName name = new ObjectName("com.javatutor.insel.jmx:type=MBeansDiagnosisProvider");
        server.registerMBean(this, name);
    }
View Full Code Here

Examples of javax.management.MBeanServer.queryMBeans()

      MBeanServer server2 = server;

      // Unregister any remaining jboss.web or Catalina MBeans
      ObjectName queryObjectName = new ObjectName(tomcatDeployer.getDomain() + ":*");
      Iterator iterator = server2.queryMBeans(queryObjectName, null).iterator();
      while (iterator.hasNext())
      {
         ObjectInstance oi = (ObjectInstance) iterator.next();
         ObjectName toRemove = oi.getObjectName();
         // Exception: Don't unregister the service right now
View Full Code Here

Examples of javax.management.MBeanServer.queryMBeans()

                ObjectName destinationObjectName = createDestinationObjectName(brokerInfo.getBrokerName(), destinationInfo.getType().name(), destinationInfo.getPhysicalName());
                QueueViewMBean proxy;
                if (!server.isRegistered(destinationObjectName)) {
                    // mbean is not yet registered.Adding the destination to activemq broker.
                    ObjectName brokerObjectName = createBrokerObjectName(brokerInfo.getBrokerName());
                    Set set = server.queryMBeans(brokerObjectName, null);
                    Iterator it = set.iterator();
                    if (it.hasNext()) {
                        ObjectInstance instance = (ObjectInstance) it.next();
                        brokerObjectName = instance.getObjectName();
                    }
View Full Code Here

Examples of javax.management.MBeanServer.queryMBeans()

            DestinationViewMBean proxy;
            if (destinationInfo.getType().equals(DestinationType.Queue)) {
                if (!server.isRegistered(objName)) {
                    // mbean is not yet registered.Adding the destination to activemq broker.
                    ObjectName brokerObj = createBrokerObjectName(brokerInfo.getBrokerName());
                    Set set = server.queryMBeans(brokerObj, null);
                    Iterator it = set.iterator();
                    if (it.hasNext()) {
                        ObjectInstance instance = (ObjectInstance) it.next();
                        brokerObj = instance.getObjectName();
                    }
View Full Code Here

Examples of javax.management.MBeanServer.queryMBeans()

                proxy = (DestinationViewMBean) MBeanServerInvocationHandler.newProxyInstance(server, objName, QueueViewMBean.class, true);
            } else {
                if (!server.isRegistered(objName)) {
                    // mbean is not yet registered.Adding the destination to activemq broker.
                    ObjectName brokerObj = createBrokerObjectName(brokerInfo.getBrokerName());
                    Set set = server.queryMBeans(brokerObj, null);
                    Iterator it = set.iterator();
                    if (it.hasNext()) {
                        ObjectInstance instance = (ObjectInstance) it.next();
                        brokerObj = instance.getObjectName();
                    }
View Full Code Here

Examples of javax.management.MBeanServer.queryMBeans()

    private boolean isInLocalMBeanServer(BrokerInfo brokerInfo) {
        try {
            ObjectName brokerObjectNameQuery = new ObjectName("org.apache.activemq" + ":*,Type=Broker");
            MBeanServer mBeanServer = getMBeanServer();
            Set<ObjectInstance> brokerObjectInstances = mBeanServer.queryMBeans(brokerObjectNameQuery, null);
            String targetBrokerId = brokerInfo.getBrokerId().getValue();
            for (ObjectInstance objectInstance : brokerObjectInstances) {
                String brokerId = (String) mBeanServer.getAttribute(objectInstance.getObjectName(), "BrokerId");
                if (targetBrokerId.equals(brokerId)) {
                    return true;
View Full Code Here

Examples of javax.management.MBeanServer.queryMBeans()

                ObjectName destinationObjectName = createDestinationObjectName(brokerInfo.getBrokerName(), destinationInfo.getType().name(), destinationInfo.getPhysicalName());
                QueueViewMBean proxy;
                if (!server.isRegistered(destinationObjectName)) {
                    // mbean is not yet registered.Adding the destination to activemq broker.
                    ObjectName brokerObjectName = createBrokerObjectName(brokerInfo.getBrokerName());
                    Set set = server.queryMBeans(brokerObjectName, null);
                    Iterator it = set.iterator();
                    if (it.hasNext()) {
                        ObjectInstance instance = (ObjectInstance) it.next();
                        brokerObjectName = instance.getObjectName();
                    }
View Full Code Here

Examples of javax.management.MBeanServer.queryMBeans()

            DestinationViewMBean proxy;
            if (destinationInfo.getType().equals(DestinationType.Queue)) {
                if (!server.isRegistered(objName)) {
                    // mbean is not yet registered.Adding the destination to activemq broker.
                    ObjectName brokerObj = createBrokerObjectName(brokerInfo.getBrokerName());
                    Set set = server.queryMBeans(brokerObj, null);
                    Iterator it = set.iterator();
                    if (it.hasNext()) {
                        ObjectInstance instance = (ObjectInstance) it.next();
                        brokerObj = instance.getObjectName();
                    }
View Full Code Here

Examples of javax.management.MBeanServer.queryMBeans()

                proxy = (DestinationViewMBean) MBeanServerInvocationHandler.newProxyInstance(server, objName, QueueViewMBean.class, true);
            } else {
                if (!server.isRegistered(objName)) {
                    // mbean is not yet registered.Adding the destination to activemq broker.
                    ObjectName brokerObj = createBrokerObjectName(brokerInfo.getBrokerName());
                    Set set = server.queryMBeans(brokerObj, null);
                    Iterator it = set.iterator();
                    if (it.hasNext()) {
                        ObjectInstance instance = (ObjectInstance) it.next();
                        brokerObj = instance.getObjectName();
                    }
View Full Code Here

Examples of javax.management.MBeanServer.queryMBeans()

    private boolean isInLocalMBeanServer(BrokerInfo brokerInfo) {
        try {
            ObjectName brokerObjectNameQuery = new ObjectName("org.apache.activemq" + ":*,Type=Broker");
            MBeanServer mBeanServer = getMBeanServer();
            Set<ObjectInstance> brokerObjectInstances = mBeanServer.queryMBeans(brokerObjectNameQuery, null);
            String targetBrokerId = brokerInfo.getBrokerId().getValue();
            for (ObjectInstance objectInstance : brokerObjectInstances) {
                String brokerId = (String) mBeanServer.getAttribute(objectInstance.getObjectName(), "BrokerId");
                if (targetBrokerId.equals(brokerId)) {
                    return true;
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.