public static Locator getLocator() {
    return InternalLocator.getLocator();
  }
Returns the locator if it exists in this JVM. Otherwise returns null.

@return the locator that exists in this JVM; null if no locator.
@since GemFire 7.0
geode-core/src/main/java/org/apache/geode/distributed/Locator.java