org.hibernate.search.reader
Class SharingBufferReaderProvider.ReaderUsagePair
java.lang.Object
org.hibernate.search.reader.SharingBufferReaderProvider.ReaderUsagePair
- Enclosing class:
- SharingBufferReaderProvider
protected final class SharingBufferReaderProvider.ReaderUsagePair
- extends java.lang.Object
Container for the couple IndexReader,UsageCounter.
|
Field Summary |
org.apache.lucene.index.IndexReader |
reader
|
protected java.util.concurrent.atomic.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. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
reader
public final org.apache.lucene.index.IndexReader reader
usageCounter
protected final java.util.concurrent.atomic.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)
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 java.lang.String toString()
- Overrides:
toString in class java.lang.Object
Copyright © 2006-2010 Hibernate. All Rights Reserved.