code: synchronized ReadOnlyIndexReader getReadOnlyIndexReader(IndexListener listener) throws IOException
     {
        // Ensure all in-memory changes are persisted before returning reader to merger
        releaseWriterAndReaders();
  
        ReadOnlyIndexReader reader = getReadOnlyIndexReader();
        this.listener = listener;
        return reader;
     }
docs: Returns a <code>ReadOnlyIndexReader</code> and registeres
  <code>listener</code> to send notifications when documents are deleted on
  <code>this</code> index.
  
  @param listener the listener to notify when documents are deleted.
  @return a <code>ReadOnlyIndexReader</code>.
  @throws IOException if the reader cannot be obtained.