net.sf.eos.lucene
Class DirectorySupplier
java.lang.Object
net.sf.eos.config.Configured
net.sf.eos.lucene.DirectorySupplier
- All Implemented Interfaces:
- Configurable, ConfigurableSupplier<org.apache.lucene.store.Directory>, Supplier<org.apache.lucene.store.Directory>
- Direct Known Subclasses:
- LocalFsDirectorySupplier
public abstract class DirectorySupplier
- extends Configured
- implements ConfigurableSupplier<org.apache.lucene.store.Directory>
Method Summary |
org.apache.lucene.store.Directory |
get()
Creates a new directory for the configuration at creation time. |
abstract org.apache.lucene.store.Directory |
get(Configuration conf)
Use the given configuration to create a new Directory instance. |
static DirectorySupplier |
newInstance(Configuration config)
Creates a new instance of a of the factory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DIRECTORY_SUPPLIER_IMPL_CONFIG_NAME
@ConfigurationKey(type=CLASSNAME,
description="Configuration key of the Lucene directory provider factory.")
public static final String DIRECTORY_SUPPLIER_IMPL_CONFIG_NAME
- The configuration key name for the classname of the factory.
- See Also:
newInstance(Configuration)
,
Constant Field Values
DirectorySupplier
public DirectorySupplier()
newInstance
@FactoryMethod(key="net.sf.eos.lucene.DirectorySupplier.impl",
implementation=LocalFsDirectorySupplier.class)
public static final DirectorySupplier newInstance(Configuration config)
throws EosException
- Creates a new instance of a of the factory. If the
Configuration
contains a key
DIRECTORY_SUPPLIER_IMPL_CONFIG_NAME
a new instance of the
classname in the value will instantiate. The
LocalFsDirectorySupplier
will instantiate if there is no
value setted.
- Parameters:
config
- the configuration
- Returns:
- a new instance
- Throws:
EosException
- if it is not possible to instantiate an instance- See Also:
LocalFsDirectorySupplier
get
public org.apache.lucene.store.Directory get()
- Creates a new directory for the configuration at creation time.
- Specified by:
get
in interface Supplier<org.apache.lucene.store.Directory>
- Returns:
- a new Lucene
Directory
instance.
- Throws:
ConfigurationException
- may thrown if misconfigured
get
public abstract org.apache.lucene.store.Directory get(Configuration conf)
- Use the given configuration to create a new
Directory
instance.
- Parameters:
conf
- the configuration to use for Directory
creating
- Returns:
- a new Lucence
Directory
- Throws:
ConfigurationException
- may thrown if misconfigured
Copyright © 2008. All Rights Reserved.