code: public synchronized boolean addPreInvalidationListener(PreInvalidationListener listener) {
          if (bEnableListener && listener != null) {
              if (eventSource.getPreInvalidationListenerCount() > 0 && tc.isDebugEnabled()) {
                  Tr.debug(tc, "addPreInvalidationListener() cacheName=" + this.cacheName + " one already exists. Overwriting old listener.");
              }
              eventSource.addListener(listener);
              return true;
          }
          return false;
      }
docs: This is a helper method to add pre-invalidation listener to all entries.