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 or stops them. Starting IndexManagers happens by creating new EntityIndexBinder instances. IndexManagers are started successively as they are needed (for example based on the sharding strategy). Stopping IndexManagers can currently only happen all at once.

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()
           
 IndexManager getOrCreateIndexManager(String indexBaseName, DynamicShardingEntityIndexBinding entityIndexBinding)
           
 IndexManager getOrCreateIndexManager(String indexBaseName, String shardName, DynamicShardingEntityIndexBinding entityIndexBinding)
           
 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)

getOrCreateIndexManager

public IndexManager getOrCreateIndexManager(String indexBaseName,
                                            DynamicShardingEntityIndexBinding entityIndexBinding)

getOrCreateIndexManager

public IndexManager getOrCreateIndexManager(String indexBaseName,
                                            String shardName,
                                            DynamicShardingEntityIndexBinding entityIndexBinding)

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-2013 Red Hat, Inc. All Rights Reserved