Package org.hibernate.search.event

Examples of org.hibernate.search.event.FullTextIndexEventListener


  }

 
  public static SearchFactoryImplementor getSearchFactoryBySFI(SessionImplementor session) {
    PostInsertEventListener[] listeners = session.getListeners().getPostInsertEventListeners();
    FullTextIndexEventListener listener = null;
    //FIXME this sucks since we mandante the event listener use
    for ( PostInsertEventListener candidate : listeners ) {
      if ( candidate instanceof FullTextIndexEventListener ) {
        listener = (FullTextIndexEventListener) candidate;
        break;
      }
    }
    if ( listener == null ) throw new HibernateException(
        "Hibernate Search Event listeners not configured, please check the reference documentation and the " +
            "application's hibernate.cfg.xml" );
    return listener.getSearchFactoryImplementor();
  }
View Full Code Here


  }

  private FullTextIndexEventListener getLuceneEventListener() {
    PostInsertEventListener[] listeners = ( ( SessionFactoryImpl ) getSessions() ).getEventListeners()
        .getPostInsertEventListeners();
    FullTextIndexEventListener listener = null;
    //FIXME this sucks since we mandate the event listener use
    for ( PostInsertEventListener candidate : listeners ) {
      if ( candidate instanceof FullTextIndexEventListener ) {
        listener = ( FullTextIndexEventListener ) candidate;
        break;
View Full Code Here

    cfg.setListener( "post-delete", "org.hibernate.search.event.FullTextIndexEventListener" );
    cfg.setListener( "post-collection-recreate", "org.hibernate.search.event.FullTextIndexEventListener" );
    cfg.setListener( "post-collection-remove", "org.hibernate.search.event.FullTextIndexEventListener" );
    cfg.setListener( "post-collection-update", "org.hibernate.search.event.FullTextIndexEventListener" );
   
    cfg.setListeners( "flush", new FlushEventListener[]{new DefaultFlushEventListener(), new FullTextIndexEventListener()} );

    cfg.setProperty( "hibernate.search.default.directory_provider", RAMDirectoryProvider.class.getName() );
    cfg.setProperty( org.hibernate.search.Environment.ANALYZER_CLASS, StopAnalyzer.class.getName() );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.search.event.FullTextIndexEventListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.