Package org.eclipse.rdf4j.sail.lucene

## Class ReaderMonitor

- java.lang.Object
- - org.eclipse.rdf4j.sail.lucene.AbstractReaderMonitor
  - - org.eclipse.rdf4j.sail.lucene.ReaderMonitor

-     public class ReaderMonitor
      extends AbstractReaderMonitor

  ReaderMonitor holds IndexReader and IndexSearcher. When ReaderMonitor is closed it do not close IndexReader and IndexSearcher as long as someone reads from them. Variable readingCount remember how many times it was read.
  Author:
    Tomasz Trela, DFKI Gmbh

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ReaderMonitor​(LuceneIndex index, org.apache.lucene.store.Directory directory)` | If exception occur when create indexReader it will be thrown on getIndexReader or get IndexSearcher

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected org.apache.lucene.search.IndexSearcher` | `getIndexSearcher()` |
    `protected void` | `handleClose()` | This method is thread-safe (i.e.

    - ### Methods inherited from class org.eclipse.rdf4j.sail.lucene.AbstractReaderMonitor

      `beginReading, close, closeWhenPossible, endReading, getReadingCount`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ReaderMonitor

          public ReaderMonitor​(LuceneIndex index,
                               org.apache.lucene.store.Directory directory)

      If exception occur when create indexReader it will be thrown on getIndexReader or get IndexSearcher
      Parameters:
        `index` -
        `directory` - Initializes IndexReader

  - ### Method Detail

    - #### handleClose

          protected void handleClose()
                              throws IOException

      Description copied from class: `AbstractReaderMonitor`
      This method is thread-safe (i.e. it is not called concurrently).
      Specified by:
        `handleClose` in class `AbstractReaderMonitor`
      Throws:
        `IOException`

    - #### getIndexSearcher

          protected org.apache.lucene.search.IndexSearcher getIndexSearcher()
                                                                     throws IOException

      Throws:
        `IOException`