Package javax.management

Examples of javax.management.MBeanServerConnection.queryNames()


      Properties env = new Properties();
      env.setProperty(Context.PROVIDER_URL, jndiURL);
      InitialContext ctx = new InitialContext(env);
      MBeanServerConnection server = (MBeanServerConnection) ctx.lookup("jmx/invoker/RMIAdaptor");
      ObjectName all = new ObjectName("*:*");
      Set allNames = server.queryNames(all, null);
      ArrayList serverErrors = new ArrayList();
      Iterator names = allNames.iterator();
      int serviceCount = 0;
      while( names.hasNext() )
      {
View Full Code Here


     
      initURLHandlers();
     
      InitialContext ctx = getInitialContext();
      MBeanServerConnection rmiAdaptor = (MBeanServerConnection)ctx.lookup("jmx/invoker/RMIAdaptor");
      Iterator it = rmiAdaptor.queryNames(null, null).iterator();
      getLog().debug("testMBeanInfoMarshalling:  rmiAdaptor = " + rmiAdaptor);
      while (it.hasNext())  
      {
         ObjectName objectName = (ObjectName)it.next();
         getLog().debug("testMBeanInfoMarshalling:  about to getMBeanInfo for objectName = " + objectName);        
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

            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

  public Set queryNames(String query) {
    Set results = new HashSet();
    MBeanServerConnection conn = getConnection();
    if (conn == null) return results;
    try {
      results = conn.queryNames(new ObjectName(query), null);
    } catch (Exception e) {
      // ignore
    }
    return results;
  }
View Full Code Here

      JMXServiceURL jmxServiceURL = JMXUtil.createQuartzInstanceConnection(config);
      JMXConnector connector = JMXConnectorFactory.connect(jmxServiceURL, env);
      MBeanServerConnection connection = connector.getMBeanServerConnection();

      ObjectName mBName = new ObjectName("quartz:type=QuartzScheduler,*");
      Set<ObjectName> names = connection.queryNames(mBName, null);
      QuartzInstance quartzInstance = new QuartzInstance();
      quartzInstance.setMBeanServerConnection(connection);
      quartzInstance.setJmxConnector(connector);

      List<Scheduler> schList = new ArrayList<Scheduler>();
View Full Code Here

            rr.set("default_domain", mbsc.getDefaultDomain());
            rr.set("mbean_count", mbsc.getMBeanCount());

      ConcurrentHashMap<ObjectName, ArrayList<String>> cache = null;
      if ( ! attribute_cache.containsKey(check.get("name")) ) {
                Set<ObjectName> allObjectNames = mbsc.queryNames(null, null);

                ArrayList<String> domains = new ArrayList<String>();
                if ( mbean_domains != null ) {
                    domains = new ArrayList<String>(Arrays.asList(mbean_domains.split("\\s+")));
                }
View Full Code Here

    public void testExposedMBeans() throws Exception {
        MBeanServerConnection connection = setupAndGetConnection(new BaseAdditionalInitialization(TYPE_STANDALONE));

        int count = connection.getMBeanCount();
        Set<ObjectInstance> instances = connection.queryMBeans(null, null);
        Set<ObjectName> objectNames = connection.queryNames(null, null);
        Assert.assertEquals(count, instances.size());
        Assert.assertEquals(count, objectNames.size());
        checkSameMBeans(instances, objectNames);
        assertContainsNames(objectNames, ROOT_NAME, INTERFACE_NAME, SOCKET_BINDING_GROUP_NAME, SERVER_SOCKET_BINDING_NAME,
                SUBSYSTEM_NAME);
View Full Code Here

        assertContainsNames(objectNames, ROOT_NAME, INTERFACE_NAME, SOCKET_BINDING_GROUP_NAME, SERVER_SOCKET_BINDING_NAME,
                SUBSYSTEM_NAME);

        Set<ObjectInstance> filteredInstances = connection.queryMBeans(createObjectName(Constants.DOMAIN + ":socket-binding-group=*,*"),
                null);
        Set<ObjectName> filteredNames = connection.queryNames(createObjectName(Constants.DOMAIN + ":socket-binding-group=*,*"), null);
        Assert.assertEquals(2, filteredInstances.size());
        Assert.assertEquals(2, filteredNames.size());
        checkSameMBeans(filteredInstances, filteredNames);
        assertContainsNames(objectNames, SOCKET_BINDING_GROUP_NAME, SERVER_SOCKET_BINDING_NAME);

View Full Code Here

    public void testAddMethodSingleFixedChild() throws Exception {
        final ObjectName testObjectName = createObjectName(Constants.DOMAIN + ":subsystem=test");
        final ObjectName childObjectName = createObjectName(Constants.DOMAIN + ":subsystem=test,single=only");
        MBeanServerConnection connection = setupAndGetConnection(new MBeanInfoAdditionalInitialization(TYPE_STANDALONE, new SubystemWithSingleFixedChildExtension()));

        Set<ObjectName> names = connection.queryNames(createObjectName(Constants.DOMAIN + ":subsystem=test,*"), null);
        Assert.assertEquals(1, names.size());
        Assert.assertTrue(names.contains(testObjectName));

        MBeanInfo subsystemInfo = connection.getMBeanInfo(testObjectName);
        Assert.assertEquals(0, subsystemInfo.getAttributes().length);
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.