}
public static Iterator getDomainData(String filter) throws JMException
{
MBeanServer server = getMBeanServer();
TreeMap domainData = new TreeMap();
if( server != null )
{
ObjectName filterName = null;
if( filter != null )
filterName = new ObjectName(filter);
Set objectNames = server.queryNames(filterName, 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) domainData.get(domainName);
if( data == null )
{
data = new DomainData(domainName);
domainData.put(domainName, data);
}
data.addData(mbeanData);
}
}
Iterator domainDataIter = domainData.values().iterator();
return domainDataIter;
}