org.hibernate.search.spi.BuildContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-search-engine Show documentation
Show all versions of hibernate-search-engine Show documentation
Core of the Object/Lucene mapper, query engine and index management
/*
* Hibernate Search, full-text search for your domain model
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or .
*/
package org.hibernate.search.spi;
import org.hibernate.search.engine.integration.impl.ExtendedSearchIntegrator;
import org.hibernate.search.engine.service.spi.ServiceManager;
import org.hibernate.search.exception.ErrorHandler;
import org.hibernate.search.indexes.impl.IndexManagerHolder;
/**
* Build context that can be used by some services at initialization.
*
* @author Emmanuel Bernard
* @author Hardy Ferentschik
*/
public interface BuildContext {
/**
* Returns the {@code ExtendedSearchIntegrator} instance. Do not use until after the initialize and/or start method is
* fully executed.
*
* Implementations should not cache values provided by the {@code ExtendedSearchIntegrator}, but rather access them
* each time, because the configuration can be dynamically updated and new changes made available.
*
* For example, prefer:
*
* {@code void method() {
* int size = sfi.getDirectoryProviders().size();
* }
* }
*
* over
*
* {@code void method() {
* int size = directoryProviders.size();
* }
* }
*
* where directoryProviders is a class variable.
* @return the {@link ExtendedSearchIntegrator} instance
*/
ExtendedSearchIntegrator getUninitializedSearchIntegrator();
/**
* @return the current indexing strategy as specified via {@link org.hibernate.search.cfg.Environment#INDEXING_STRATEGY}.
*/
IndexingMode getIndexingMode();
/**
* Access the {@code ServiceManager}.
*
* Clients should keep a reference to the {@code ServiceManager} to allow for cleanup, but should not keep a reference
* to the {@code BuildContext}.
*
* @return the {@link ServiceManager}
*/
ServiceManager getServiceManager();
/**
* @return a reference to the {@code IndexManagerHolder}, storing all {@code IndexManager} instances.
*/
IndexManagerHolder getAllIndexesManager();
/**
* Back-ends processing work asynchronously should catch all eventual errors in the {@code ErrorHandler}
* to avoid losing information about the failing index updates.
*
* @return the configured {@code ErrorHandler}
*/
ErrorHandler getErrorHandler();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy