Package javax.management

Examples of javax.management.MBeanServerConnection.queryNames()


      Set mbeans = connection.queryNames(null, null);
      System.out.println("MBeans retrieved by a connection without delegate subject:");
      System.out.println(mbeans);
      System.out.println();

      mbeans = delegateConnection.queryNames(null, null);
      System.out.println("MBeans retrieved by a connection with a delegate subject:");
      System.out.println(mbeans);
      System.out.println();

      // The example policy file forbids to call MBeanServerConnection.getObjectInstance
View Full Code Here


            out.println(server.getMBeanCount());
            break;

         case LIST_NAMES:
            ObjectName all = new ObjectName("*:*");
            Set names = server.queryNames(all, null);
            Iterator iter = names.iterator();
            while( iter.hasNext() )
               out.println(iter.next());
            break;

View Full Code Here

      throws Exception
   {
      // query the mbean server
      MBeanServerConnection server = getMBeanServer();
     
      Set matches = server.queryNames(new ObjectName(query), null);
      log.debug("Query matches: " + matches);

      if (matches.size() == 0) {
         throw new CommandException("No MBean matches for query: " + query);
      }
View Full Code Here

       
        try
        {
            MBeanServerConnection server = getServer(serverIndex);
           
            List<ObjectName> names = new ArrayList<ObjectName>(server.queryNames(new ObjectName(domain+":*"), null));           

            List<String> result = new ArrayList<String>();
           
            for(Object name : names) {
                result.add(name.toString().substring(domain.length()+1));
View Full Code Here

        // connector server is bound to
        MBeanServerConnection connection = connector.getMBeanServerConnection();

        LOGGER.info(connection.getMBeanCount().toString());

        Set set = connection.queryNames(new ObjectName(connection.getDefaultDomain() + ":*"), null);
        for (Iterator iter = set.iterator(); iter.hasNext();) {
            ObjectName name = (ObjectName) iter.next();
            LOGGER.info(name.toString());
            MBeanInfo info = connection.getMBeanInfo(name);
            MBeanAttributeInfo[] mia = info.getAttributes();
View Full Code Here

            MBeanServerConnection mbsc = getMBeanServerConnection();
            /*
             *Use the MBean to retrieve the ObjectNames of all children of this module on this target.
             */
            ObjectName query = new ObjectName("com.sun.appserv:category=runtime,name=" + moduleID + ",J2EEServer=" + sunTarget.getAppServerInstance() + ",*");
            Set mbeans = mbsc.queryNames(query, null);
           
            /*
             *Work through the child ObjectNames, adding appropriately-constructed SunTargetModuleIDs
             *as children of the SunTargetModuleID of the parent J2EE module.
             */
 
View Full Code Here

                /*
                 *Retrieve the list of child module names of the module's ObjectName.
                 */
                String subModules[] = (String[]) mbsc.getAttribute(module, "modules");
                for (int i = 0; i < subModules.length; i++) {
                    Set subModuleObjectNames = mbsc.queryNames(new ObjectName(subModules[i]), null);
                    if (subModuleObjectNames != null) {
                        /*
                         *The MBean returned some children, so iterate through them and prepare a sub TMID.
                         */
                        for (Iterator subItr = subModuleObjectNames.iterator(); subItr.hasNext(); ) {
View Full Code Here

         {
            cntor1 = JMXConnectorFactory.connect(cntorServer1.getAddress(), getEnvironment());
            cntor2 = JMXConnectorFactory.connect(cntorServer2.getAddress(), getEnvironment());

            MBeanServerConnection conn1 = cntor1.getMBeanServerConnection();
            Set names = conn1.queryNames(null, null);
            assertNotNull(names);
            assertTrue(names.size() > 0);

            MBeanServerConnection conn2 = cntor2.getMBeanServerConnection();
            names = conn2.queryNames(null, null);
View Full Code Here

            Set names = conn1.queryNames(null, null);
            assertNotNull(names);
            assertTrue(names.size() > 0);

            MBeanServerConnection conn2 = cntor2.getMBeanServerConnection();
            names = conn2.queryNames(null, null);
            assertNotNull(names);
            assertTrue(names.size() > 0);

            cntorServer1.stop();
View Full Code Here

            }
            catch (IOException ignored)
            {
            }

            names = conn2.queryNames(null, null);
            assertNotNull(names);
            assertTrue(names.size() > 0);
         }
         catch (Exception x)
         {
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.