private void operateOnCache(InternalCache cache) {
    final boolean isDebugEnabled = logger.isDebugEnabled();
    if (cache.getCacheServers().size() == 0) {

      for (DistributedRegion r : getDistributedRegions(cache)) {
        CacheDistributionAdvisor cda = r.getDistributionAdvisor();
        CacheDistributionAdvisor.CacheProfile cp =
            (CacheDistributionAdvisor.CacheProfile) cda.getProfile(getSender());
        if (cp != null) {
          if (isDebugEnabled) {
            logger.debug("Setting hasCacheServer flag to false on region \"{}\" for {}",
                r.getFullPath(), getSender());
          }
          cp.hasCacheServer = false;
        }
      }
      for (PartitionedRegion r : getPartitionedRegions(cache)) {
        CacheDistributionAdvisor cda = (CacheDistributionAdvisor) r.getDistributionAdvisor();
        CacheDistributionAdvisor.CacheProfile cp =
            (CacheDistributionAdvisor.CacheProfile) cda.getProfile(getSender());
        if (cp != null) {
          if (isDebugEnabled) {
            logger.debug("Setting hasCacheServer flag to false on region \"{}\" for {}",
                r.getFullPath(), getSender());
          }
          cp.hasCacheServer = false;
        }
      }
    }
  }
OperationMessage synchronously propagates a change in the profile to another member. It is a
serial message so that there is no chance of out-of-order execution.
geode-core/src/main/java/org/apache/geode/internal/cache/RemoveCacheServerProfileMessage.java