org.modeshape.search.lucene
Class LuceneConfigurations.RamDirectoryFactory

java.lang.Object
  extended by org.modeshape.search.lucene.LuceneConfigurations.PoolingDirectoryFactory<org.apache.lucene.store.RAMDirectory>
      extended by org.modeshape.search.lucene.LuceneConfigurations.RamDirectoryFactory
All Implemented Interfaces:
LuceneConfiguration
Enclosing class:
LuceneConfigurations

@ThreadSafe
public static class LuceneConfigurations.RamDirectoryFactory
extends LuceneConfigurations.PoolingDirectoryFactory<org.apache.lucene.store.RAMDirectory>

A LuceneConfiguration implementation that creates RAMDirectory instances for each workspace and index name. Each factory instance maintains a pool of RAMDirectory instances, ensuring that the same RAMDirectory is always returned for the same workspace name.


Constructor Summary
protected LuceneConfigurations.RamDirectoryFactory()
           
 
Method Summary
protected  org.apache.lucene.store.RAMDirectory createDirectory(String workspaceName, String indexName)
          Method implemented by subclasses to create a new Directory implementation.
protected  boolean doDestroy(org.apache.lucene.store.RAMDirectory directory)
          
 org.apache.lucene.util.Version getVersion()
          Get the version for the Lucene configuration.
 
Methods inherited from class org.modeshape.search.lucene.LuceneConfigurations.PoolingDirectoryFactory
destroyDirectory, getDirectory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneConfigurations.RamDirectoryFactory

protected LuceneConfigurations.RamDirectoryFactory()
Method Detail

getVersion

public org.apache.lucene.util.Version getVersion()
Get the version for the Lucene configuration.

Returns:
the version
See Also:
LuceneConfiguration.getVersion()

createDirectory

protected org.apache.lucene.store.RAMDirectory createDirectory(String workspaceName,
                                                               String indexName)
Description copied from class: LuceneConfigurations.PoolingDirectoryFactory
Method implemented by subclasses to create a new Directory implementation.

Specified by:
createDirectory in class LuceneConfigurations.PoolingDirectoryFactory<org.apache.lucene.store.RAMDirectory>
Parameters:
workspaceName - the name of the workspace for which the Directory is to be created; never null
indexName - the name of the index to be created
Returns:
the new directory; may not be null

doDestroy

protected boolean doDestroy(org.apache.lucene.store.RAMDirectory directory)
                     throws SearchEngineException

Specified by:
doDestroy in class LuceneConfigurations.PoolingDirectoryFactory<org.apache.lucene.store.RAMDirectory>
Throws:
SearchEngineException
See Also:
LuceneConfigurations.PoolingDirectoryFactory.doDestroy(org.apache.lucene.store.Directory)


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.