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

Author:
Emmanuel Bernard

Method Summary
 IndexManagerHolder getAllIndexesManager()
           
 ErrorHandler getErrorHandler()
          For backends processing work asynchronously, they should catch all eventual errors in the ErrorHandler to avoid losing information about the lost updates.
 String getIndexingStrategy()
           
 SearchFactoryImplementor getUninitializedSearchFactory()
          Returns the SessionFactoryImplementor instance.
 void releaseService(Class<? extends ServiceProvider<?>> provider)
          Release a service from duty.
<T> T
requestService(Class<? extends ServiceProvider<T>> provider)
          Declare the use of a service.
 

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: when the configuration is dynamically updated, new changes are available through the SearchFactoryImplementor For example, prefer void method() { int size = sfi.getDirectoryProviders().size(); } to void method() { int size = directoryProviders.size(); } where directoryProviders is a class variable.


getIndexingStrategy

String getIndexingStrategy()

requestService

<T> T requestService(Class<? extends ServiceProvider<T>> provider)
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

void releaseService(Class<? extends ServiceProvider<?>> provider)
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

getAllIndexesManager

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

getErrorHandler

ErrorHandler getErrorHandler()
For backends processing work asynchronously, they should catch all eventual errors in the ErrorHandler to avoid losing information about the lost updates.

Returns:
the configured ErrorHandler


Copyright © 2006-2012 Red Hat Middleware, LLC. All Rights Reserved