예제 #1
0
 @Override
 public List<URI> getServices() {
   try {
     // TODO: FIXME - This is a hack to get consistent results from discovery
     Thread.sleep(500);
     return serviceSelector.selectHttpService();
   } catch (InterruptedException e) {
     throw new NoSuchElementException(
         SERVICE_NAME + " Service not found - " + serviceSelector.toString());
   }
 }
예제 #2
0
  @Override
  public URI getService() throws NoSuchElementException {
    List<URI> services = getServices();

    if (services.size() > 0) {
      return services.get(0);
    }
    throw new NoSuchElementException(
        SERVICE_NAME + " Service not found - " + serviceSelector.toString());
  }