org.hibernate.search.indexes.impl
Class IndexManagerHolder

java.lang.Object
  extended by org.hibernate.search.indexes.impl.IndexManagerHolder

public class IndexManagerHolder
extends Object

Stores references to IndexManager instances, and starts/stops them. Starting IndexManagers happens by creating new EntityIndexBinder instances, while creating the binders if we hit the need for a new IndexManager, or several according to a sharding strategy, the new IndexManagers are started incrementally. Stopping IndexManager can not currently happen decrementally: to stop the IndexManagers all of them are stopped.

Author:
Emmanuel Bernard, Sylvain Vieujot, Hardy Ferentschik, Sanne Grinovero

Constructor Summary
IndexManagerHolder()
           
 
Method Summary
 MutableEntityIndexBinding buildEntityIndexBinding(org.hibernate.annotations.common.reflection.XClass entity, Class mappedClass, SearchConfiguration cfg, WorkerBuildContext context)
           
 IndexManager getIndexManager(String targetIndexName)
           
 Collection<IndexManager> getIndexManagers()
           
 void setActiveSearchFactory(SearchFactoryImplementorWithShareableState factory)
          Useful for MutableSearchFactory, this haves all managed IndexManagers switch over to the new SearchFactory.
 void stop()
          Stops all IndexManager instances
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexManagerHolder

public IndexManagerHolder()
Method Detail

buildEntityIndexBinding

public MutableEntityIndexBinding buildEntityIndexBinding(org.hibernate.annotations.common.reflection.XClass entity,
                                                         Class mappedClass,
                                                         SearchConfiguration cfg,
                                                         WorkerBuildContext context)

getIndexManagers

public Collection<IndexManager> getIndexManagers()
Returns:
all IndexManager instances

setActiveSearchFactory

public void setActiveSearchFactory(SearchFactoryImplementorWithShareableState factory)
Useful for MutableSearchFactory, this haves all managed IndexManagers switch over to the new SearchFactory.

Parameters:
factory - the new SearchFactory to set on each IndexManager.

stop

public void stop()
Stops all IndexManager instances


getIndexManager

public IndexManager getIndexManager(String targetIndexName)
Parameters:
targetIndexName - the name of the IndexManager to look up
Returns:
the IndexManager, or null if it doesn't exist


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