org.hibernate.search.event
Class ContextHolder

java.lang.Object
  extended by org.hibernate.search.event.ContextHolder

public class ContextHolder
extends java.lang.Object

Holds already built SearchFactory per Hibernate Configuration object concurrent threads do not share this information This code uses ThreadLocal and despite the weak hashMap use, some users claim to see memory leaks (in Tomcat as usual). So if that can be avoided, do not use this class. There is no clean hook to always remove the SearchFactory from the map.

Author:
Emmanuel Bernard

Constructor Summary
ContextHolder()
           
 
Method Summary
static SearchFactoryImpl getOrBuildSearchFactory(org.hibernate.cfg.Configuration cfg)
           
static void removeSearchFactoryFromCache(SearchFactoryImplementor factory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextHolder

public ContextHolder()
Method Detail

getOrBuildSearchFactory

public static SearchFactoryImpl getOrBuildSearchFactory(org.hibernate.cfg.Configuration cfg)

removeSearchFactoryFromCache

public static void removeSearchFactoryFromCache(SearchFactoryImplementor factory)


Copyright © 2006-2010 Hibernate. All Rights Reserved.