public void setHaveCacheLoader() {
    if (!haveCacheLoader) {
      haveCacheLoader = true;
    }
  }
This method checks if region is closed or destroyed.
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java