gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/util/GemFireInspector.java
public static Set<String> listHosts(JMX jmx)
	{
		Set<ObjectName> memberObjects = jmx.searchObjectNames("GemFire:type=Member,member=*");
		
		if(memberObjects == null || memberObjects.isEmpty())
		{
			return null;
		}
		
		HashSet<String> hostList = new HashSet<String>(memberObjects.size());
		
		MemberMXBean  bean = null;
		for (ObjectName objectName : memberObjects)
		{
			bean = jmx.newBean(MemberMXBean.class, objectName);
			try
			{
				hostList.add(bean.getHost());
			}
			catch(UndeclaredThrowableException e)
			{
				//will not be added
			}
		}
		return hostList;
	}
public static Set<String> listHosts(JMX jmx)
	{
		Set<ObjectName> memberObjects = jmx.searchObjectNames("GemFire:type=Member,member=*");
		
		if(memberObjects == null || memberObjects.isEmpty())
		{
			return null;
		}
		
		HashSet<String> hostList = new HashSet<String>(memberObjects.size());
		
		MemberMXBean  bean = null;
		for (ObjectName objectName : memberObjects)
		{
			bean = jmx.newBean(MemberMXBean.class, objectName);
			try
			{
				hostList.add(bean.getHost());
			}
			catch(UndeclaredThrowableException e)
			{
				//will not be added
			}
		}
		return hostList;
	}
public static Set < String > listHosts ( JMX jmx ) { Set < ObjectName > memberObjects = jmx . searchObjectNames ( "GemFire:type=Member,member=*" ) ; if ( memberObjects == null || memberObjects . isEmpty ( ) ) { return null ; } HashSet < String > hostList = new HashSet < String > ( memberObjects . size ( ) ) ; MemberMXBean bean = null ; for ( ObjectName objectName : memberObjects ) { bean = jmx . newBean ( MemberMXBean . class , objectName ) ; try { hostList . add ( bean . getHost ( ) ) ; } catch ( UndeclaredThrowableException e ) { //will not be added } } return hostList ; }
List the unique set of host name
@param jmx the JMX connection
@return set of host names
List the unique set of host name