Class EmbeddedSolrServerFactory
java.lang.Object
org.springframework.data.solr.server.support.EmbeddedSolrServerFactory
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean,SolrClientFactory
- Direct Known Subclasses:
EmbeddedSolrServerFactoryBean
public class EmbeddedSolrServerFactory
extends Object
implements SolrClientFactory, org.springframework.beans.factory.DisposableBean
The EmbeddedSolrServerFactory allows hosting of an SolrServer instance in embedded mode. Configuration files are
loaded via
ResourceUtils, therefore it is possible to place them in classpath. Use this class for Testing. It
is not recommended for production.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal org.apache.solr.client.solrj.embedded.EmbeddedSolrServervoiddestroy()getCores()org.apache.solr.client.solrj.embedded.EmbeddedSolrServerGet baseSolrClientinstanceprotected voidvoidsetSolrHome(String solrHome) void
-
Constructor Details
-
EmbeddedSolrServerFactory
protected EmbeddedSolrServerFactory() -
EmbeddedSolrServerFactory
public EmbeddedSolrServerFactory(String solrHome) throws ParserConfigurationException, IOException, SAXException - Parameters:
solrHome- Any Path expression valid for use withResourceUtilsthat points to thesolr.solr.homedirectory- Throws:
ParserConfigurationExceptionIOExceptionSAXException
-
-
Method Details
-
getSolrClient
public org.apache.solr.client.solrj.embedded.EmbeddedSolrServer getSolrClient()Description copied from interface:SolrClientFactoryGet baseSolrClientinstance- Specified by:
getSolrClientin interfaceSolrClientFactory- Returns:
- a reusable SolrClient instance
-
initCoreContainer
protected void initCoreContainer() -
createPathConfiguredSolrServer
public final org.apache.solr.client.solrj.embedded.EmbeddedSolrServer createPathConfiguredSolrServer(String path) throws ParserConfigurationException, IOException, SAXException - Parameters:
path- Any Path expression valid for use withResourceUtils- Returns:
- new instance of
EmbeddedSolrServer - Throws:
ParserConfigurationExceptionIOExceptionSAXException
-
shutdownSolrServer
public void shutdownSolrServer() -
getCores
-
setSolrHome
-
destroy
- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
Exception
-