public static Collection < String > listHosts ( JMX jmx ) { Set < ObjectName > objectNames = jmx . searchObjectNames ( "GemFire:type=Member,member=*" ) ; if ( objectNames == null || objectNames . isEmpty ( ) ) { return null ; } HashSet < String > hostLists = new HashSet < String > ( objectNames . size ( ) ) ; MemberMXBean memberMXBean = null ; for ( ObjectName objectName : objectNames ) { memberMXBean = jmx . newBean ( MemberMXBean . class , objectName ) ; hostLists . add ( memberMXBean . getHost ( ) ) ; } return hostLists ; }
Determines the unique set of the host names for the distributed system