org.hibernate.search.indexes.impl
Class SharingBufferReaderProvider.ReaderUsagePair

java.lang.Object
  extended by org.hibernate.search.indexes.impl.SharingBufferReaderProvider.ReaderUsagePair
Enclosing class:
SharingBufferReaderProvider

protected final class SharingBufferReaderProvider.ReaderUsagePair
extends Object

Container for the couple IndexReader,UsageCounter.


Field Summary
 org.apache.lucene.index.IndexReader reader
           
protected  AtomicInteger usageCounter
          When reaching 0 (always test on change) the reader should be really closed and then discarded.
 
Method Summary
 void close()
          Closes the IndexReader if no other resource is using it in which case the reference to this container will also be removed.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

reader

public final org.apache.lucene.index.IndexReader reader

usageCounter

protected final AtomicInteger usageCounter
When reaching 0 (always test on change) the reader should be really closed and then discarded. Starts at 2 because: first usage token is artificial: means "current" is not to be closed (+1) additionally when creating it will be used (+1)

Method Detail

close

public void close()
Closes the IndexReader if no other resource is using it in which case the reference to this container will also be removed.


toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006-2012 Red Hat Middleware, LLC. All Rights Reserved