public synchronized boolean setServices(
      final Services<ID> services) {
    if (this.services == null || this.services.isStopped()) {
      this.services = services;
      localAddress = this.services.getMessenger().getMemberID();
      Objects.requireNonNull(localAddress, "member address should have been established");
      logger.info("Peer locator is connecting to local membership services with ID {}",
          localAddress);
      GMSMembershipView<ID> newView = this.services.getJoinLeave().getView();
      if (newView != null) {
        view = newView;
        recoveredView = null;
      } else {
        // if we are auto-reconnecting we may already have a membership view
        // and should use it as a "recovered view" which only hints at who is
        // the current membership coordinator
        if (view != null) {
          view.setViewId(-100); // no longer a valid view
          recoveredView = view; // auto-reconnect will be based on the recovered view
          view = null;
        }
        if (localAddress != null) {
          if (recoveredView != null) {
            recoveredView.remove(localAddress);
          }
          synchronized (registrants) {
            registrants.add(localAddress);
          }
        }
      }
      notifyAll();
      return true;
    }
    return false;
  }
Called initially and after each auto-reconnect. See restart handlers in InternalLocator
up in geode-core. Services must be started before this call.
geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java