Package org.hibernate.search.spi

Examples of org.hibernate.search.spi.SearchFactoryIntegrator


   }

   private void registerQueryMBeans(AdvancedCache cache,
         ComponentRegistry cr, String cacheName) {
      Configuration cfg = cache.getCacheConfiguration();
      SearchFactoryIntegrator sf = getSearchFactory(
            cfg.indexing().properties(), cr);

      // Resolve MBean server instance
      GlobalConfiguration globalCfg =
            cr.getGlobalComponentRegistry().getGlobalConfiguration();
View Full Code Here


      return interceptorChain.containsInterceptorType(QueryInterceptor.class, true);
   }

   private SearchFactoryIntegrator getSearchFactory(Properties indexingProperties, ComponentRegistry cr) {
      Object component = cr.getComponent(SearchFactoryIntegrator.class);
      SearchFactoryIntegrator searchFactory = null;
      if (component instanceof SearchFactoryIntegrator) { //could be the placeholder Object REMOVED_REGISTRY_COMPONENT
         searchFactory = (SearchFactoryIntegrator) component;
      }
      //defend against multiple initialization:
      if (searchFactory==null) {
View Full Code Here

      }
   }

   @Override
   public void cacheStopped(ComponentRegistry cr, String cacheName) {
      SearchFactoryIntegrator searchFactoryIntegrator = searchFactoriesToShutdown.remove(cacheName);
      if (searchFactoryIntegrator != null) {
         searchFactoryIntegrator.close();
      }

      Configuration cfg = cr.getComponent(Configuration.class);
      removeQueryInterceptorFromConfiguration(cfg);
   }
View Full Code Here

  private SingleEntityQueryBuilder<Query> queryBuilder;

  @Before
  public void setupQueryBuilder() {
    SearchFactoryIntegrator searchFactory = factoryHolder.getSearchFactory();
    QueryContextBuilder queryContextBuilder = searchFactory.buildQueryBuilder();
    EntityNamesResolver nameResolver = MapBasedEntityNamesResolver.forClasses( IndexedEntity.class );
    PropertyHelper propertyHelper = new ClassBasedLucenePropertyHelper( searchFactory, nameResolver );

    queryBuilder = SingleEntityQueryBuilder.getInstance(
        new LucenePredicateFactory( queryContextBuilder, nameResolver ),
View Full Code Here

  @Rule
  public SearchFactoryHolder factoryHolder = new SearchFactoryHolder( IndexedEntity.class );

  @Override
  protected LuceneProcessingChain setUpLuceneProcessingChain(Map<String, Object> namedParameters) {
    SearchFactoryIntegrator searchFactory = factoryHolder.getSearchFactory();
    EntityNamesResolver nameResolver = MapBasedEntityNamesResolver.forClasses( IndexedEntity.class );

    return new LuceneProcessingChain.Builder( searchFactory, nameResolver )
      .namedParameters( namedParameters )
      .buildProcessingChainForClassBasedEntities();
View Full Code Here

  @Rule
  public SearchFactoryHolder factoryHolder = new SearchFactoryHolder( GenericValueHolder.class );

  @Override
  protected LuceneProcessingChain setUpLuceneProcessingChain(Map<String, Object> namedParameters) {
    SearchFactoryIntegrator searchFactory = factoryHolder.getSearchFactory();
    EntityNamesResolver nameResolver = new ConstantEntityNamesResolver();

    return new LuceneProcessingChain.Builder( searchFactory, nameResolver )
      .namedParameters( namedParameters )
      .buildProcessingChainForDynamicEntities( new TestFieldBridgeProvider() );
View Full Code Here

    */
   @Override
   public void cacheStarting(ComponentRegistry cr, Configuration cfg, String cacheName) {
      if (cfg.indexing().index().isEnabled()) {
         log.registeringQueryInterceptor();
         SearchFactoryIntegrator searchFactory = getSearchFactory(cfg.indexing().properties(), cr);
         createQueryInterceptorIfNeeded(cr, cfg, searchFactory);
      }
   }
View Full Code Here

   }

   private void registerQueryMBeans(AdvancedCache cache,
         ComponentRegistry cr, String cacheName) {
      Configuration cfg = cache.getCacheConfiguration();
      SearchFactoryIntegrator sf = getSearchFactory(
            cfg.indexing().properties(), cr);

      // Resolve MBean server instance
      GlobalConfiguration globalCfg =
            cr.getGlobalComponentRegistry().getGlobalConfiguration();
View Full Code Here

      return interceptorChain.containsInterceptorType(QueryInterceptor.class, true);
   }

   private SearchFactoryIntegrator getSearchFactory(Properties indexingProperties, ComponentRegistry cr) {
      Object component = cr.getComponent(SearchFactoryIntegrator.class);
      SearchFactoryIntegrator searchFactory = null;
      if (component instanceof SearchFactoryIntegrator) { //could be the placeholder Object REMOVED_REGISTRY_COMPONENT
         searchFactory = (SearchFactoryIntegrator) component;
      }
      //defend against multiple initialization:
      if (searchFactory==null) {
View Full Code Here

      }
   }

   @Override
   public void cacheStopped(ComponentRegistry cr, String cacheName) {
      SearchFactoryIntegrator searchFactoryIntegrator = searchFactoriesToShutdown.remove(cacheName);
      if (searchFactoryIntegrator != null) {
         searchFactoryIntegrator.close();
      }

      Configuration cfg = cr.getComponent(Configuration.class);
      removeQueryInterceptorFromConfiguration(cfg);
   }
View Full Code Here

TOP

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

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.