net.sf.eos.lucene
Class SearcherSupplier

java.lang.Object
  extended by net.sf.eos.config.Configured
      extended by net.sf.eos.lucene.SearcherSupplier
All Implemented Interfaces:
Configurable, Supplier<org.apache.lucene.search.Searcher>
Direct Known Subclasses:
IndexSearcherSupplier

public abstract class SearcherSupplier
extends Configured
implements Supplier<org.apache.lucene.search.Searcher>


Field Summary
static String SEARCHER_SUPPLIER_IMPL_CONFIG_NAME
          The configuration key name for the classname of the factory.
 
Constructor Summary
SearcherSupplier()
           
 
Method Summary
 org.apache.lucene.search.Searcher get()
          Creates a new searchable for the configuration at creation time.
abstract  org.apache.lucene.search.Searcher get(Configuration conf)
          Use the given configuration to create a new Searchable instance.
static SearcherSupplier newInstance(Configuration config)
          Creates a new instance of a of the factory.
 
Methods inherited from class net.sf.eos.config.Configured
configure, getConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEARCHER_SUPPLIER_IMPL_CONFIG_NAME

@ConfigurationKey(type=CLASSNAME,
                  description="Configuration key of the search supplier.")
public static final String SEARCHER_SUPPLIER_IMPL_CONFIG_NAME
The configuration key name for the classname of the factory.

See Also:
newInstance(Configuration), Constant Field Values
Constructor Detail

SearcherSupplier

public SearcherSupplier()
Method Detail

newInstance

@FactoryMethod(key="net.sf.eos.lucene.SearcherSupplier.impl",
               implementation=IndexSearcherSupplier.class)
public static final SearcherSupplier newInstance(Configuration config)
                                          throws EosException
Creates a new instance of a of the factory. If the Configuration contains a key SEARCHER_SUPPLIER_IMPL_CONFIG_NAME a new instance of the classname in the value will instantiate. The IndexSearcherSupplier 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:
IndexSearcherSupplier

get

public org.apache.lucene.search.Searcher get()
Creates a new searchable for the configuration at creation time.

Specified by:
get in interface Supplier<org.apache.lucene.search.Searcher>
Returns:
a new Lucene Searchable instance.
Throws:
ConfigurationException - may thrown if misconfigured

get

public abstract org.apache.lucene.search.Searcher get(Configuration conf)
Use the given configuration to create a new Searchable instance.

Parameters:
conf - the configuration to use for Searchable creating
Returns:
a new Lucence Searchable
Throws:
ConfigurationException - may thrown if misconfigured


Copyright © 2008. All Rights Reserved.