Package org.hibernate.search.spi
Interface BuildContext
- All Known Subinterfaces:
WorkerBuildContext,WritableBuildContext
- All Known Implementing Classes:
ImmutableSearchFactory
public interface BuildContext
Build context that can be used by some services at initialization
-
Method Summary
Modifier and TypeMethodDescriptiongetDirectoryProviderLock(DirectoryProvider<?> provider) This method cannot be used in initialize methods.Set<DirectoryProvider<?>> Returns the SessionFactoryImplementor instance.voidreleaseService(Class<? extends ServiceProvider<?>> provider) Release a service from duty.<T> TrequestService(Class<? extends ServiceProvider<T>> provider) Declare the use of a service.
-
Method Details
-
getUninitializedSearchFactory
SearchFactoryImplementor getUninitializedSearchFactory()Returns the SessionFactoryImplementor instance. Do not use until after the initialize and/or start method is fully executed. Implementations should not cache values provided by the SessionFactoryImplementor but rather access them each time: when the configuration is dynamically updated, new changes are available through the SearchFactoryImplementor For example, prefervoid method() { int size = sfi.getDirectoryProviders().size(); }tovoid method() { int size = directoryProviders.size(); }where directoryProviders is a class variable. -
getIndexingStrategy
String getIndexingStrategy() -
getDirectoryProviders
Set<DirectoryProvider<?>> getDirectoryProviders() -
getDirectoryProviderLock
This method cannot be used in initialize methods. start methods can use it though.- Parameters:
provider-- Returns:
-
requestService
Declare the use of a service. All callers of this method must call (@link #releaseService} or the service will not be released- Type Parameters:
T- class of the service- Parameters:
provider- of the service- Returns:
- the service instance
-
releaseService
Release a service from duty. Each call to (@link #requestService} should be coupled with a call to (@link #releaseService} when the service is no longer needed.- Parameters:
provider- of the service
-