org.hibernate.search.engine.impl
Class EmptyBuildContext

java.lang.Object
  extended by org.hibernate.search.engine.impl.EmptyBuildContext
All Implemented Interfaces:
BuildContext

Deprecated.

@Deprecated
public class EmptyBuildContext
extends Object
implements BuildContext

Lazily loaded Services might need a BuilContext to retrieve additional services; in such a case we can wrap a reference to a ServiceManager and a SearchFactoryImplementor to create a limited BuildContext: we're out of the boot phase at this point so not all operations are legal. This isn't great design but we need it to temporarily keep backwards compatibility, so this class was deprecated since it's first version.

Author:
Sanne Grinovero (C) 2012 Red Hat Inc.

Constructor Summary
EmptyBuildContext(ServiceManager delegate, SearchFactoryImplementor searchFactory)
          Deprecated.  
 
Method Summary
 IndexManagerHolder getAllIndexesManager()
          Deprecated. To not be used on this BuildContext implementation.
 ErrorHandler getErrorHandler()
          Deprecated. To not be used on this BuildContext implementation.
 String getIndexingStrategy()
          Deprecated. To not be used on this BuildContext implementation.
 ServiceManager getServiceManager()
          Deprecated. Access the ServiceManager.
 SearchFactoryImplementor getUninitializedSearchFactory()
          Deprecated. Returns the SessionFactoryImplementor instance.
 void releaseService(Class<? extends ServiceProvider<?>> provider)
          Deprecated. 
<T> T
requestService(Class<? extends ServiceProvider<T>> provider)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmptyBuildContext

public EmptyBuildContext(ServiceManager delegate,
                         SearchFactoryImplementor searchFactory)
Deprecated. 
Method Detail

requestService

@Deprecated
public <T> T requestService(Class<? extends ServiceProvider<T>> provider)
Deprecated. 

Description copied from interface: BuildContext
Declare the use of a service. All callers of this method must call (@link #releaseService} or the service will not be released

Specified by:
requestService in interface BuildContext
Type Parameters:
T - class of the service
Parameters:
provider - of the service
Returns:
the service instance

releaseService

@Deprecated
public void releaseService(Class<? extends ServiceProvider<?>> provider)
Deprecated. 

Description copied from interface: BuildContext
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.

Specified by:
releaseService in interface BuildContext
Parameters:
provider - of the service

getServiceManager

public ServiceManager getServiceManager()
Deprecated. 
Description copied from interface: BuildContext
Access the ServiceManager. Service users should keep a reference to the ServiceManager to allow for cleanup, but should never keep a reference to the BuildContext.

Specified by:
getServiceManager in interface BuildContext

getUninitializedSearchFactory

public SearchFactoryImplementor getUninitializedSearchFactory()
Deprecated. 
Description copied from interface: BuildContext
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.

Specified by:
getUninitializedSearchFactory in interface BuildContext

getIndexingStrategy

public String getIndexingStrategy()
Deprecated. 
To not be used on this BuildContext implementation.

Specified by:
getIndexingStrategy in interface BuildContext
Throws:
SearchException - Always thrown.

getAllIndexesManager

public IndexManagerHolder getAllIndexesManager()
Deprecated. 
To not be used on this BuildContext implementation.

Specified by:
getAllIndexesManager in interface BuildContext
Returns:
a reference to the IndexManagerHolder, storing all IndexManager instances.
Throws:
SearchException - Always thrown.

getErrorHandler

public ErrorHandler getErrorHandler()
Deprecated. 
To not be used on this BuildContext implementation.

Specified by:
getErrorHandler in interface BuildContext
Returns:
the configured ErrorHandler
Throws:
SearchException - Always thrown.


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