Package org.hibernate.search.reader
Interface ReaderProvider
- All Known Implementing Classes:
NotSharedReaderProvider,SharedReaderProvider,SharingBufferReaderProvider
public interface ReaderProvider
Responsible for providing and managing the lifecycle of a read only reader. The implementation must have a
no-arg constructor.
Note that the reader must be closed once opened.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcloseReader(IndexReader reader) Close a reader previously opened byopenReader(org.hibernate.search.store.DirectoryProvider...).voiddestroy()Called when aSearchFactoryis destroyed.voidinitialize(Properties props, BuildContext context) Initialize the reader provider before its use.openReader(DirectoryProvider... directoryProviders) Open a read-only reader on all the listed directory providers.
-
Method Details
-
openReader
Open a read-only reader on all the listed directory providers. The opened reader has to be closed throughcloseReader(IndexReader). The opening can be virtual. -
closeReader
Close a reader previously opened byopenReader(org.hibernate.search.store.DirectoryProvider...). The closing can be virtual. -
initialize
Initialize the reader provider before its use. -
destroy
void destroy()Called when aSearchFactoryis destroyed. This method typically releases resources. It is guaranteed to be executed after readers are released by queries (assuming no user error).
-