3 Replies Latest reply on Apr 2, 2012 3:45 PM by yashendra chandrakar

    jboss ListenerInjector and custom hibernate event listener registration

    yashendra chandrakar Newbie

      Hi,

       

      Is there any alternative interface to org.jboss.hibernate.ListenerInjector in JBoss 7.1?

       

      Our project have a class which implements org.jboss.hibernate.ListenerInjector.

       

      Implemented method calls setProperty and setListener methods on passed hibernate Configuration object.

       

      I wonder how to migrate this code to JBoss 7.1.

       

      Do I need to configure those custom hibernate event listener in persistence.xml, something like this:

       

              <properties>
                 
      <property name="hibernate.ejb.event.post-collection-recreate" value="org.hibernate.search.event.impl.FullTextIndexEventListener"/>

                  <property name="hibernate.ejb.event.post-insert" value="org.hibernate.search.event.impl.FullTextIndexEventListener"/>

                  <property name="hibernate.ejb.event.post-delete" value="org.hibernate.search.event.impl.FullTextIndexEventListener"/>

              </properties>

       

      But how do I configure such things:

       

              configuration.setProperty("hibernate.search.default.indexBase", indexPath);

              configuration.setProperty("hibernate.search.worker.execution", "sync");

              configuration.setProperty("hibernate.search.reader.strategy", "shared-segments");

              configuration.setProperty("hibernate.search.default.directory_provider", "org.hibernate.search.store.impl.FSDirectoryProvider");