org.apache.solr.core
Class SolrConfig

java.lang.Object
  extended by org.apache.solr.core.SolrConfig

public class SolrConfig
extends java.lang.Object

Provides a static reference to a Config object modeling the main configuration data for a a Solr instance -- typically found in "solrconfig.xml".

Version:
$Id: SolrConfig.java 535431 2007-05-05 01:04:08Z ryan $
Author:
yonik

Field Summary
static Config config
          Singleton containing all configuration.
static java.lang.String DEFAULT_CONF_FILE
           
static java.util.Collection<java.lang.Throwable> severeErrors
          Singleton keeping track of configuration errors
 
Constructor Summary
SolrConfig()
           
 
Method Summary
static SolrQueryRequest getPingQueryRequest(SolrCore core)
          Returns a Request object based on the admin/pingQuery section of the Solr config file.
static void initConfig(java.lang.String file)
          (Re)loads the static configuration information from the specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONF_FILE

public static final java.lang.String DEFAULT_CONF_FILE
See Also:
Constant Field Values

config

public static Config config
Singleton containing all configuration.


severeErrors

public static final java.util.Collection<java.lang.Throwable> severeErrors
Singleton keeping track of configuration errors

Constructor Detail

SolrConfig

public SolrConfig()
Method Detail

initConfig

public static void initConfig(java.lang.String file)
                       throws javax.xml.parsers.ParserConfigurationException,
                              java.io.IOException,
                              org.xml.sax.SAXException
(Re)loads the static configuration information from the specified file.

This method is called implicitly on ClassLoad, but it may be called explicitly to change the Configuration used for the purpose of testing - in which case it should be called prior to initializing a SolrCore.

This method should only be called for testing purposes. Because it modifies a singleton, it is not suitable for running multi-threaded tests.

Parameters:
file - file name to load
Throws:
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
See Also:
Config.openResource(java.lang.String)

getPingQueryRequest

public static SolrQueryRequest getPingQueryRequest(SolrCore core)
Returns a Request object based on the admin/pingQuery section of the Solr config file.



Copyright © 2006 - 2009 The Apache Software Foundation