org.hibernate.search.spi
Interface BuildContext

All Known Subinterfaces:
WorkerBuildContext, WritableBuildContext
All Known Implementing Classes:
EmptyBuildContext, ImmutableSearchFactory, MutableSearchFactory

public interface BuildContext

Build context that can be used by some services at initialization.

Author:
Emmanuel Bernard

Method Summary
 IndexManagerHolder getAllIndexesManager()
           
 ErrorHandler getErrorHandler()
          Back-ends processing work asynchronously should catch all eventual errors in the ErrorHandler to avoid losing information about the failing index updates.
 String getIndexingStrategy()
          Returns the configured indexing strategy (event vs manual).
 ServiceManager getServiceManager()
          Access the ServiceManager.
 SearchFactoryImplementor getUninitializedSearchFactory()
          Returns the SessionFactoryImplementor instance.
 void releaseService(Class<? extends ServiceProvider<?>> provider)
          Deprecated. use getServiceManager() instead
<T> T
requestService(Class<? extends ServiceProvider<T>> provider)
          Deprecated. use getServiceManager() instead
 

Method Detail

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, because the configuration can be dynamically updated and new changes made available. For example, prefer:
 void method() {
   int size = sfi.getDirectoryProviders().size();
 }
 
 
over
 void method() {
 int size = directoryProviders.size();
 }
 
 
where directoryProviders is a class variable.


getIndexingStrategy

String getIndexingStrategy()
Returns the configured indexing strategy (event vs manual).

Returns:
hte configured indexing strategy
See Also:
Environment.INDEXING_STRATEGY

requestService

@Deprecated
<T> T requestService(Class<? extends ServiceProvider<T>> provider)
Deprecated. use getServiceManager() instead

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

@Deprecated
void releaseService(Class<? extends ServiceProvider<?>> provider)
Deprecated. use getServiceManager() instead

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

getServiceManager

ServiceManager getServiceManager()
Access the ServiceManager. Clients should keep a reference to the ServiceManager to allow for cleanup, but should not keep a reference to the BuildContext.


getAllIndexesManager

IndexManagerHolder getAllIndexesManager()
Returns:
a reference to the IndexManagerHolder, storing all IndexManager instances.

getErrorHandler

ErrorHandler getErrorHandler()
Back-ends processing work asynchronously should catch all eventual errors in the ErrorHandler to avoid losing information about the failing index updates.

Returns:
the configured ErrorHandler


Copyright © 2006–2013 Hibernate. All rights reserved.