Package org.hibernate.search.spi

Examples of org.hibernate.search.spi.MassIndexerFactory


    //this is an open discussion
  }

  @Override
  public MassIndexer createIndexer(Class<?>... types) {
    MassIndexerFactory massIndexerFactory = createMassIndexerFactory();
    return massIndexerFactory.createMassIndexer( getSearchFactoryImplementor(), getFactory(), types );
  }
View Full Code Here


  public FullTextSharedSessionBuilder sessionWithOptions() {
    return new FullTextSharedSessionBuilderDelegator( super.sessionWithOptions() );
  }

  private MassIndexerFactory createMassIndexerFactory() {
    MassIndexerFactory factory;
    Properties properties = getSearchFactoryImplementor().getConfigurationProperties();
    String factoryClassName = properties.getProperty( MassIndexerFactory.MASS_INDEXER_FACTORY_CLASSNAME );

    if ( factoryClassName != null ) {
      SearchFactoryImplementor searchFactoryImplementor = getSearchFactoryImplementor();
      ServiceManager serviceManager = searchFactoryImplementor.getServiceManager();
      factory = ClassLoaderHelper.instanceFromName(
          MassIndexerFactory.class, factoryClassName, "Mass indexer factory", serviceManager
      );
    }
    else {
      factory = new DefaultMassIndexerFactory();
    }
    factory.initialize( properties );
    return factory;
  }
View Full Code Here

  public MassIndexer createIndexer(Class<?>... types) {
    //We shouldn't expose the ServiceManager in phases other than startup or teardown, that's why the cast is required.
    //Exceptionally, this very specific case is fine. TODO: cleanup this mess.
    MutableSearchFactory msf = (MutableSearchFactory) getSearchFactoryImplementor();
    ServiceManager serviceManager = msf.getServiceManager();
    MassIndexerFactory service = serviceManager.requestService( MassIndexerFactoryProvider.class, null );
    return service.createMassIndexer( getSearchFactoryImplementor(), getFactory(), types );
  }
View Full Code Here

  public MassIndexer createIndexer(Class<?>... types) {
    //We shouldn't expose the ServiceManager in phases other than startup or teardown, that's why the cast is required.
    //Exceptionally, this very specific case is fine. TODO: cleanup this mess.
    MutableSearchFactory msf = (MutableSearchFactory) getSearchFactoryImplementor();
    ServiceManager serviceManager = msf.getServiceManager();
    MassIndexerFactory service = serviceManager.requestService( MassIndexerFactoryProvider.class, null );
    return service.createMassIndexer( getSearchFactoryImplementor(), getSessionFactory(), types );
  }
View Full Code Here

  public MassIndexer createIndexer(Class<?>... types) {
    //We shouldn't expose the ServiceManager in phases other than startup or teardown, that's why the cast is required.
    //Exceptionally, this very specific case is fine. TODO: cleanup this mess.
    MutableSearchFactory msf = (MutableSearchFactory) getSearchFactoryImplementor();
    ServiceManager serviceManager = msf.getServiceManager();
    MassIndexerFactory service = serviceManager.requestService( MassIndexerFactoryProvider.class, null );
    try {
      return service.createMassIndexer( getSearchFactoryImplementor(), getFactory(), types );
    }
    finally {
      serviceManager.releaseService( MassIndexerFactoryProvider.class );
    }
  }
View Full Code Here

  public MassIndexer createIndexer(Class<?>... types) {
    //We shouldn't expose the ServiceManager in phases other than startup or teardown, that's why the cast is required.
    //Exceptionally, this very specific case is fine. TODO: cleanup this mess.
    MutableSearchFactory msf = (MutableSearchFactory) getSearchFactoryImplementor();
    ServiceManager serviceManager = msf.getServiceManager();
    MassIndexerFactory service = serviceManager.requestService( MassIndexerFactoryProvider.class, null );
    try {
      return service.createMassIndexer( getSearchFactoryImplementor(), getFactory(), types );
    }
    finally {
      serviceManager.releaseService( MassIndexerFactoryProvider.class );
    }
  }
View Full Code Here

  public MassIndexer createIndexer(Class<?>... types) {
    //We shouldn't expose the ServiceManager in phases other than startup or teardown, that's why the cast is required.
    //Exceptionally, this very specific case is fine. TODO: cleanup this mess.
    MutableSearchFactory msf = (MutableSearchFactory) getSearchFactoryImplementor();
    ServiceManager serviceManager = msf.getServiceManager();
    MassIndexerFactory service = serviceManager.requestService( MassIndexerFactoryProvider.class, null );
    return service.createMassIndexer( getSearchFactoryImplementor(), getFactory(), types );
  }
View Full Code Here

  public MassIndexer createIndexer(Class<?>... types) {
    //We shouldn't expose the ServiceManager in phases other than startup or teardown, that's why the cast is required.
    //Exceptionally, this very specific case is fine. TODO: cleanup this mess.
    MutableSearchFactory msf = (MutableSearchFactory) getSearchFactoryImplementor();
    ServiceManager serviceManager = msf.getServiceManager();
    MassIndexerFactory service = serviceManager.requestService( MassIndexerFactoryProvider.class, null );
    return service.createMassIndexer( getSearchFactoryImplementor(), getFactory(), types );
  }
View Full Code Here

    //another solution would be to subclass SessionImpl instead of having this LuceneSession delegation model
    //this is an open discussion
  }

  public MassIndexer createIndexer(Class<?>... types) {
    MassIndexerFactory factory = requestService( MassIndexerFactory.class );
    return factory.createMassIndexer( getSearchFactoryImplementor(), getSessionFactory(), types );
  }
View Full Code Here

  public MassIndexer createIndexer(Class<?>... types) {
    //We shouldn't expose the ServiceManager in phases other than startup or teardown, that's why the cast is required.
    //Exceptionally, this very specific case is fine. TODO: cleanup this mess.
    MutableSearchFactory msf = (MutableSearchFactory) getSearchFactoryImplementor();
    ServiceManager serviceManager = msf.getServiceManager();
    MassIndexerFactory service = serviceManager.requestService( MassIndexerFactoryProvider.class, null );
    return service.createMassIndexer( getSearchFactoryImplementor(), getFactory(), types );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.search.spi.MassIndexerFactory

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.