private ClientCache basicCreate() {
    synchronized (ClientCacheFactory.class) {
      InternalClientCache instance = getInternalClientCache();

      {
        String propValue = dsProps.getProperty(MCAST_PORT);
        if (propValue != null) {
          int mcastPort = Integer.parseInt(propValue);
          if (mcastPort != 0) {
            throw new IllegalStateException(
                "On a client cache the mcast-port must be set to 0 or not set. It was set to "
                    + mcastPort);
          }
        }
      }
      {
        String propValue = dsProps.getProperty(LOCATORS);
        if (propValue != null && !propValue.isEmpty()) {
          throw new IllegalStateException(
              "On a client cache the locators property must be set to an empty string or not set."
                  + " It was set to \""
                  + propValue + "\".");
        }
      }
      dsProps.setProperty(MCAST_PORT, "0");
      dsProps.setProperty(LOCATORS, "");
      InternalDistributedSystem system = connectInternalDistributedSystem();

      if (instance != null && !instance.isClosed()) {
        // this is ok; just make sure it is a client cache
        if (!instance.isClient()) {
          throw new IllegalStateException(
              "A client cache can not be created because a non-client cache already exists.");
        }

        // check if pool is compatible
        instance.validatePoolFactory(pf);

        // Check if cache configuration matches.
        cacheConfig.validateCacheConfig(instance);

        return instance;
      } else {

        return (InternalClientCache) new InternalCacheBuilder(cacheConfig)
            .setIsClient(true)
            .setPoolFactory(pf)
            .create(system);
      }
    }
  }
Create a singleton client cache. If a client cache already exists in this vm that is not
compatible with this factory's configuration then create will fail.
<p>
While creating the cache instance any declarative cache configuration (cache.xml) is processed
and used to initialize the created cache.
<P>
Note that the cache that is produced is a singleton. Before a different instance can be
produced the old one must be {@link ClientCache#close closed}.

@return the singleton client cache
@throws CacheXmlException If a problem occurs while parsing the declarative caching XML file.
@throws TimeoutException If a {@link Region#put(Object, Object)} times out while initializing
        the cache.
@throws CacheWriterException If a <code>CacheWriterException</code> is thrown while
        initializing the cache.
@throws RegionExistsException If the declarative caching XML file describes a region that
        already exists (including the root region).
@throws IllegalStateException if a client cache already exists and it is not compatible with
        this factory's configuration.
@throws IllegalStateException if mcast-port or locator is set on client cache.
@throws AuthenticationFailedException if authentication fails.
@throws AuthenticationRequiredException if server is in secure mode and client cache is not
        configured with security credentials.
geode-core/src/main/java/org/apache/geode/cache/client/ClientCacheFactory.java