private static void setLocator(InternalLocator locator) {
    synchronized (locatorLock) {
      if (InternalLocator.locator != null && InternalLocator.locator != locator) {
        throw new IllegalStateException(
            "A locator can not be created because one already exists in this JVM.");
      }

      InternalLocator.locator = locator;
    }
  }
Create a locator that listens on a given port. This locator will not have peer or server
location services available until they are started by calling startServerLocation or
startPeerLocation on the locator object.

@param port the tcp/ip port to listen on
@param loggingSession the LoggingSession to use, may be a NullLoggingSession which does
       nothing
@param logFile the file that log messages should be written to
@param logWriter a log writer that should be used (logFile parameter is ignored)
@param securityLogWriter the logWriter to be used for security related log messages
@param bindAddress the bind address for the locator
@param distributedSystemProperties optional properties to configure the distributed system
       (e.g., mcast addr/port, other locators)
@param workingDirectory the working directory to use for any files
geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java