Skip to content
Commits on May 9, 2012
  1. @Sanne
  2. @Sanne
  3. @Sanne
  4. @hferentschik @Sanne

    HSEARCH-1115 ClassLoaderHelper#classForName takes now the classloader…

    … as second parameter instead of the caller class
    
    Re-added the explicit passing of the caller's classloader to ConfigContext and DocumentBuilderHelper
    hferentschik committed with Sanne May 8, 2012
  5. @hferentschik @Sanne
  6. @hferentschik @Sanne

    HSEARCH-1115 Doing all class loading via ClassLoaderHelper. Also doin…

    …g moving the classForName methods from commons annotations into ClassLoaderHelper.
    hferentschik committed with Sanne May 8, 2012
  7. @emmanuelbernard @Sanne

    HSEARCH-1115 Make sure to load Hibernate / JPA exceptions with the "b…

    …est" classloader
    
    commons-annotations is not the correct classloader in a modular environment
    emmanuelbernard committed with Sanne May 7, 2012
  8. @emmanuelbernard @Sanne

    HSEARCH-1115 Avoid reflection when we have the data and pass the righ…

    …t caller for modular environments
    
    Since ReflectHelper is in Commons Annotations which depends on nothing, it's critical
    to provider the right caller
    emmanuelbernard committed with Sanne May 7, 2012
  9. @rhauch @Sanne

    HSEARCH-1115 Changed use of ReflectHelper to specify classloader

    Two uses of ReflectHelper.classForName(String) were changed to use the
    classForName(String,Class) form instead. In the latter method, if
    the class cannot be found on the thread's context class loader then the
    class will be loaded using the classloader of the class specified in
    the second parameter.
    
    In one of the cases (DocumentBuilderHelper), the DocumentBuilderHelper class
    was passed, meaning that the same classloader used to load the Hibernate Search
    classes will be used.
    
    In the second case (ConfigContext), the second parameter is the class of
    the SearchConfiguration implementation that was supplied to the ConfigContext.
    This is better than the ConfigContext class, since the SearchConfiguration
    implementation will be provided by the components using the SearchFactoryBuilder
    to build a SearchFactory. This means that the components' classloader
    will be used to load the Analyzer implementation class.
    
    There are a few other uses of ReflectionHelper.classForName(String) in the Hibernate
    Search codebase, but I don't think they require the same classloading logic.
    
    When used in a Java SE environment, there is no net difference in classloading
    behavior. However, in JBoss AS7 (or even OSGi) the different classloaders have
    a significant effect. Specifically, when used in JBoss AS7, the modules might look
    like this (where "-->" signifies 'depends on'):
    
      org.foo (uses Hibernate Search, implements SearchConfiguration)
       --> org.hibernate.search.engine
           --> org.hibernate (specifically the hibernate-commons-annotations JAR)
           --> org.apache.lucene
           --> others
    
    In this case, the result of the code before this change is that ConfigContext
    would expect to find the Analyzer implementation using the 'org.hibernate'
    module (where the ReflectHelper class exists), which does cannot see any of
    the 'org.apache.lucene' Analyzer implementations nor any implementations
    provided by 'org.foo'. After this change, ConfigContext uses 'org.foo' classloader
    (since that's where the SearchConfiguration class exists), and thus can see
    any Analyzer implementation provide in 'org.foo', 'org.hibernate.search.engine',
    'org.apache.lucene', 'org.hibernate' (if there were any), or any of the other
    modules.
    
    All unit tests run by the build pass successfully with these changes.
    rhauch committed with Sanne May 4, 2012
Commits on May 7, 2012
  1. @hferentschik @emmanuelbernard
  2. @hferentschik @emmanuelbernard
  3. @hferentschik @emmanuelbernard
  4. @hferentschik @emmanuelbernard

    HSEARCH-1118 Making sure that hibernate.search.worker.scope is used i…

    …nstead of just worker.scope
    hferentschik committed with emmanuelbernard May 7, 2012
  5. @hferentschik @emmanuelbernard
  6. @hferentschik @emmanuelbernard
Commits on May 4, 2012
  1. @Sanne
  2. @Sanne
  3. @Sanne
  4. @Sanne
  5. @Sanne

    add missing copyright headers

    Sanne committed Apr 26, 2012
  6. @golovnin @Sanne
  7. @Sanne
  8. @gbadner @Sanne
  9. @Sanne

    HSEARCH-1088 Specifying an analyzer on an entity class bridge using t…

    …he programmatic API is broken
    Sanne committed Apr 24, 2012
  10. @emmanuelbernard @Sanne
  11. @Sanne
  12. @Sanne
  13. @Sanne
  14. @Sanne
  15. @Sanne
  16. @Sanne
  17. @Sanne
  18. @Sanne
  19. @Sanne
  20. @Sanne
Something went wrong with that request. Please try again.