code: public static Iterator getDomainData() throws JMException
     {
        MBeanServer server = getMBeanServer();
        TreeMap<String, DomainData> domainData = new TreeMap<String, DomainData>();
  
        if (server != null)
        {
           Set objectNames = server.queryNames(null, null);
           Iterator objectNamesIter = objectNames.iterator();
  
           while (objectNamesIter.hasNext())
           {
              ObjectName name = (ObjectName)objectNamesIter.next();
              MBeanInfo info = server.getMBeanInfo(name);
              String domainName = name.getDomain();
              MBeanData mbeanData = new MBeanData(name, info);
              DomainData data = domainData.get(domainName);
  
              if (data == null)
              {
                 data = new DomainData(domainName);
                 domainData.put(domainName, data);
              }
  
              data.addData(mbeanData);
           }
        }
  
        return domainData.values().iterator();
     }
docs: Get the domain data
  @return The data iterator
  @exception JMException Thrown if an error occurs