コード例 #1
0
 /**
  * Verifies if the indexing interceptor is aware of a specific list of types.
  *
  * @param cache the cache containing the indexes
  * @param types vararg listing the types the indexing engine should know
  */
 private void assertIndexingKnows(Cache<Object, Object> cache, Class<?>... types) {
   ComponentRegistry cr = cache.getAdvancedCache().getComponentRegistry();
   SearchIntegrator searchIntegrator = cr.getComponent(SearchIntegrator.class);
   assertNotNull(searchIntegrator);
   Map<Class<?>, EntityIndexBinding> indexBindingForEntity =
       searchIntegrator.unwrap(ExtendedSearchIntegrator.class).getIndexBindings();
   assertNotNull(indexBindingForEntity);
   Set<Class<?>> keySet = indexBindingForEntity.keySet();
   assertEquals(types.length, keySet.size());
   assertTrue(keySet.containsAll(Arrays.asList(types)));
 }
コード例 #2
0
 protected MassIndexerImpl(
     SearchIntegrator searchIntegrator,
     SessionFactoryImplementor sessionFactory,
     Class<?>... entities) {
   this.extendedIntegrator = searchIntegrator.unwrap(ExtendedSearchIntegrator.class);
   this.sessionFactory = sessionFactory;
   rootEntities = toRootEntities(extendedIntegrator, entities);
   if (extendedIntegrator.isJMXEnabled()) {
     monitor = new JMXRegistrar.IndexingProgressMonitor();
   } else {
     monitor = new SimpleIndexingProgressMonitor();
   }
 }