de.pangaea.metadataportal.utils
Class AutoCloseIndexReader

java.lang.Object
  extended by org.apache.lucene.index.IndexReader
      extended by org.apache.lucene.index.FilterIndexReader
          extended by de.pangaea.metadataportal.utils.AutoCloseIndexReader
All Implemented Interfaces:
Closeable, Cloneable

public final class AutoCloseIndexReader
extends org.apache.lucene.index.FilterIndexReader

AutoCloseIndexReader is used by IndexConfig.getSharedIndexReader() to make IndexReaders cleanup by GC possible.

Author:
Uwe Schindler

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.index.FilterIndexReader
org.apache.lucene.index.FilterIndexReader.FilterTermDocs, org.apache.lucene.index.FilterIndexReader.FilterTermEnum, org.apache.lucene.index.FilterIndexReader.FilterTermPositions
 
Nested classes/interfaces inherited from class org.apache.lucene.index.IndexReader
org.apache.lucene.index.IndexReader.FieldOption
 
Field Summary
 
Fields inherited from class org.apache.lucene.index.FilterIndexReader
in
 
Fields inherited from class org.apache.lucene.index.IndexReader
hasChanges
 
Constructor Summary
AutoCloseIndexReader(org.apache.lucene.index.IndexReader in, String name)
           
 
Method Summary
protected  void doClose()
           
protected  void finalize()
          Close the index automatically.
 void hardClose()
           
 org.apache.lucene.index.IndexReader reopen()
           
 
Methods inherited from class org.apache.lucene.index.FilterIndexReader
directory, docFreq, doCommit, document, doDelete, doSetNorm, doUndeleteAll, getDeletesCacheKey, getFieldCacheKey, getFieldNames, getSequentialSubReaders, getTermFreqVector, getTermFreqVector, getTermFreqVector, getTermFreqVectors, getVersion, hasDeletions, hasNorms, isCurrent, isDeleted, isOptimized, maxDoc, norms, norms, numDocs, termDocs, termDocs, termPositions, terms, terms
 
Methods inherited from class org.apache.lucene.index.IndexReader
acquireWriteLock, clone, clone, close, commit, commit, decRef, deleteDocument, deleteDocuments, document, ensureOpen, flush, flush, getCommitUserData, getCommitUserData, getCurrentVersion, getIndexCommit, getRefCount, getTermInfosIndexDivisor, getUniqueTermCount, incRef, indexExists, lastModified, listCommits, main, numDeletedDocs, open, open, open, open, open, open, open, reopen, reopen, setNorm, setNorm, termPositions, undeleteAll
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoCloseIndexReader

public AutoCloseIndexReader(org.apache.lucene.index.IndexReader in,
                            String name)
Method Detail

doClose

protected final void doClose()
                      throws IOException
Overrides:
doClose in class org.apache.lucene.index.FilterIndexReader
Throws:
IOException

reopen

public final org.apache.lucene.index.IndexReader reopen()
                                                 throws org.apache.lucene.index.CorruptIndexException,
                                                        IOException
Overrides:
reopen in class org.apache.lucene.index.IndexReader
Throws:
org.apache.lucene.index.CorruptIndexException
IOException

hardClose

public final void hardClose()
                     throws org.apache.lucene.index.CorruptIndexException,
                            IOException
Throws:
org.apache.lucene.index.CorruptIndexException
IOException

finalize

protected void finalize()
                 throws Throwable
Close the index automatically.

Overrides:
finalize in class Object
Throws:
Throwable


Copyright ©2007-2009 panFMP Developers c/o Uwe Schindler