org.hibernate.search.backend
Class Workspace

java.lang.Object
  extended by org.hibernate.search.backend.Workspace

public class Workspace
extends Object

Lucene workspace This is not intended to be used in a multithreaded environment

One cannot execute modification through an IndexReader when an IndexWriter has been acquired on the same underlying directory One cannot get an IndexWriter when an IndexReader have been acquired and modificed on the same underlying directory The recommended approach is to execute all the modifications on the IndexReaders, clean() }, and acquire the index writers

Author:
Emmanuel Bernard

Constructor Summary
Workspace(Map<Class,DocumentBuilder<Object>> documentBuilders, Map<DirectoryProvider,java.util.concurrent.locks.ReentrantLock> lockableDirectoryProviders)
           
 
Method Summary
 void clean()
          release resources consumed in the workspace if any
 DocumentBuilder getDocumentBuilder(Class entity)
           
 org.apache.lucene.index.IndexReader getIndexReader(Class entity)
           
 org.apache.lucene.index.IndexWriter getIndexWriter(Class entity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Workspace

public Workspace(Map<Class,DocumentBuilder<Object>> documentBuilders,
                 Map<DirectoryProvider,java.util.concurrent.locks.ReentrantLock> lockableDirectoryProviders)
Method Detail

getDocumentBuilder

public DocumentBuilder getDocumentBuilder(Class entity)

getIndexReader

public org.apache.lucene.index.IndexReader getIndexReader(Class entity)

getIndexWriter

public org.apache.lucene.index.IndexWriter getIndexWriter(Class entity)

clean

public void clean()
release resources consumed in the workspace if any