private void lookupInstances ( String args [ ] ) { String serviceName = args [ 1 ] ; System . out . println ( "lookupInstances, serviceName=" + serviceName ) ; try { List < ServiceInstance > instances = ServiceDirectory . getLookupManager ( ) . lookupInstances ( serviceName ) ; if ( instances . size ( ) == 0 ) { print ( "" ) ; } else { for ( ServiceInstance instance : instances ) { printServiceInstance ( instance ) ; } } } catch ( ServiceException e ) { e . printStackTrace ( ) ; fail ( e . getServiceDirectoryError ( ) . getErrorMessage ( ) ) ; } }
Do the lookupInstances command .