public void destroy() throws Exception {
    Region<K, V> region = getObject();
    // unregister interests
    try {
      if (region != null && !ObjectUtils.isEmpty(interests)) {
        for (Interest<K> interest : interests) {
          if (interest instanceof RegexInterest) {
            region.unregisterInterestRegex((String) interest.getKey());
          } else {
            region.unregisterInterest(interest.getKey());
          }
        }
      }
      // should not really happen since interests are validated at start/registration
    } catch (UnsupportedOperationException ex) {
      log.warn("Cannot unregister cache interests", ex);
    }

    if (region != null) {
      if (close) {
        if (!region.getCache().isClosed()) {
          try {
            region.close();
          } catch (CacheClosedException cce) {
            // nothing to see folks, move on.
          }
        }
      } else if (destroy) {
        region.destroyRegion();
      }
    }
    region = null;
  }