code: public Registry getRegistry() throws RemoteException {
          if (registry == null) {
              if (StringUtils.hasText(host)) {
                  registry = LocateRegistry.getRegistry(host, port);
              } else {
                  registry = LocateRegistry.getRegistry(port);
              }
          }
  
          return registry;
      }
docs: Gets the RMI registry based on host and port settings in this configuration.
  @return
  @throws RemoteException