class RemoteServiceDescriptor {

  public ServiceDescriptor getServiceDescriptor() throws IOException, ServerException {
    if (serviceDescriptor == null) {
      synchronized (this) {
        if (serviceDescriptor == null) {
          try {
            serviceDescriptor =
                requestFactory
                    .fromUrl(baseUrl)
                    .useOptionsMethod()
                    .request()
                    .as(getServiceDescriptorClass(), null);
          } catch (NotFoundException
              | ConflictException
              | UnauthorizedException
              | BadRequestException
              | ForbiddenException e) {
            throw new ServerException(e.getServiceError());
          }
        }
      }
    }
    return serviceDescriptor;
  }

  public  RemoteServiceDescriptor(String baseUrl, HttpJsonRequestFactory requestFactory);

}