@Override
  public CacheListener getCacheListener() {
    CacheListener[] listeners = fetchCacheListenersField();
    if (listeners == null || listeners.length == 0) {
      return null;
    }
    if (listeners.length == 1) {
      return listeners[0];
    } else {
      throw new IllegalStateException(
          "More than one cache listener exists.");
    }
  }
Return a cache writer if this region has one. Note if region's writer is used to implement
bridge then null is returned.

@since GemFire 5.7
geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegion.java