Package org.hibernate.search.spi.internals

Examples of org.hibernate.search.spi.internals.PolymorphicIndexHierarchy


      rootFactory = new MutableSearchFactory();
      factoryState.setDocumentBuildersIndexedEntities( new HashMap<Class<?>, DocumentBuilderIndexedEntity<?>>() );
      factoryState.setDocumentBuildersContainedEntities( new HashMap<Class<?>, DocumentBuilderContainedEntity<?>>() );
      factoryState.setDirectoryProviderData( new HashMap<DirectoryProvider<?>, DirectoryProviderData>() );
      factoryState.setFilterDefinitions( new HashMap<String, FilterDef>() );
      factoryState.setIndexHierarchy( new PolymorphicIndexHierarchy() );
      factoryState.setConfigurationProperties( cfg.getProperties() );
      factoryState.setErrorHandler( createErrorHandler( factoryState.getConfigurationProperties() ) );
      factoryState.setServiceManager( new ServiceManager( cfg ) );
    }
  }
View Full Code Here


    Iterator<Class<?>> iter = cfg.getClassMappings();
    DirectoryProviderFactory factory = new DirectoryProviderFactory();

    initProgrammaticAnalyzers( context, reflectionManager );
    initProgrammaticallyDefinedFilterDef( reflectionManager );
    final PolymorphicIndexHierarchy indexingHierarchy = factoryState.getIndexHierarchy();
    final Map<Class<?>, DocumentBuilderIndexedEntity<?>> documentBuildersIndexedEntities = factoryState.getDocumentBuildersIndexedEntities();
    final Map<Class<?>, DocumentBuilderContainedEntity<?>> documentBuildersContainedEntities = factoryState.getDocumentBuildersContainedEntities();
    while ( iter.hasNext() ) {
      Class<?> mappedClass = iter.next();
      if ( mappedClass == null ) {
        continue;
      }
      @SuppressWarnings("unchecked")
      XClass mappedXClass = reflectionManager.toXClass( mappedClass );
      if ( mappedXClass == null ) {
        continue;
      }

      if ( mappedXClass.isAnnotationPresent( Indexed.class ) ) {

        if ( mappedXClass.isAbstract() ) {
          log.warn( "Abstract classes can never insert index documents. Remove @Indexed." );
          continue;
        }

        DirectoryProviderFactory.DirectoryProviders providers = factory.createDirectoryProviders(
            mappedXClass, cfg, buildContext, reflectionManager
        );
        //FIXME DocumentBuilderIndexedEntity needs to be built by a helper method receiving Class<T> to infer T properly
        //XClass unfortunately is not (yet) genericized: TODO?
        final DocumentBuilderIndexedEntity<?> documentBuilder =
            new DocumentBuilderIndexedEntity(
                mappedXClass,
                context,
                providers,
                reflectionManager
        );

        indexingHierarchy.addIndexedClass( mappedClass );
        documentBuildersIndexedEntities.put( mappedClass, documentBuilder );
      }
      else {
        //FIXME DocumentBuilderIndexedEntity needs to be built by a helper method receiving Class<T> to infer T properly
        //XClass unfortunately is not (yet) genericized: TODO?
View Full Code Here

      rootFactory = new MutableSearchFactory();
      documentBuildersIndexedEntities = new HashMap<Class<?>, DocumentBuilderIndexedEntity<?>>();
      documentBuildersContainedEntities = new HashMap<Class<?>, DocumentBuilderContainedEntity<?>>();
      dirProviderData = new HashMap<DirectoryProvider<?>, DirectoryProviderData>();
      filterDefinitions = new HashMap<String, FilterDef>();
      indexHierarchy = new PolymorphicIndexHierarchy();
    }
  }
View Full Code Here

      //set the mutable structure of factory state
      rootFactory = new MutableSearchFactory();
      factoryState.setDocumentBuildersIndexedEntities( new ConcurrentHashMap<Class<?>, EntityIndexBinding>() );
      factoryState.setDocumentBuildersContainedEntities( new ConcurrentHashMap<Class<?>, DocumentBuilderContainedEntity<?>>() );
      factoryState.setFilterDefinitions( new ConcurrentHashMap<String, FilterDef>() );
      factoryState.setIndexHierarchy( new PolymorphicIndexHierarchy() );
      factoryState.setConfigurationProperties( cfg.getProperties() );
      factoryState.setServiceManager( new StandardServiceManager( cfg ) );
      factoryState.setAllIndexesManager( new IndexManagerHolder() );
      factoryState.setErrorHandler( createErrorHandler( cfg ) );
      factoryState.setInstanceInitializer( cfg.getInstanceInitializer() );
View Full Code Here

  private void initDocumentBuilders(SearchConfiguration cfg, BuildContext buildContext, SearchMapping searchMapping) {
    ConfigContext context = new ConfigContext( cfg, searchMapping );

    initProgrammaticAnalyzers( context, cfg.getReflectionManager() );
    initProgrammaticallyDefinedFilterDef( cfg.getReflectionManager() );
    final PolymorphicIndexHierarchy indexingHierarchy = factoryState.getIndexHierarchy();
    final Map<Class<?>, EntityIndexBinding> documentBuildersIndexedEntities = factoryState.getIndexBindings();
    final Map<Class<?>, DocumentBuilderContainedEntity<?>> documentBuildersContainedEntities = factoryState.getDocumentBuildersContainedEntities();
    final Set<XClass> optimizationBlackListedTypes = new HashSet<XClass>();
    final Map<XClass, Class<?>> classMappings = initializeClassMappings( cfg, cfg.getReflectionManager() );

    //we process the @Indexed classes last, so we first start all IndexManager(s).
    final List<XClass> rootIndexedEntities = new LinkedList<XClass>();

    for ( Map.Entry<XClass, Class<?>> mapping : classMappings.entrySet() ) {

      XClass mappedXClass = mapping.getKey();
      Class<?> mappedClass = mapping.getValue();

      if ( mappedXClass.isAnnotationPresent( Indexed.class ) ) {

        if ( mappedXClass.isAbstract() ) {
          log.abstractClassesCannotInsertDocuments();
          continue;
        }

        rootIndexedEntities.add( mappedXClass );
        indexingHierarchy.addIndexedClass( mappedClass );
      }
      else {
        //FIXME DocumentBuilderIndexedEntity needs to be built by a helper method receiving Class<T> to infer T properly
        //XClass unfortunately is not (yet) genericized: TODO?
        final DocumentBuilderContainedEntity<?> documentBuilder = new DocumentBuilderContainedEntity(
View Full Code Here

      //set the mutable structure of factory state
      rootFactory = new MutableSearchFactory();
      factoryState.setDocumentBuildersIndexedEntities( new ConcurrentHashMap<Class<?>, EntityIndexBinder>() );
      factoryState.setDocumentBuildersContainedEntities( new ConcurrentHashMap<Class<?>, DocumentBuilderContainedEntity<?>>() );
      factoryState.setFilterDefinitions( new ConcurrentHashMap<String, FilterDef>() );
      factoryState.setIndexHierarchy( new PolymorphicIndexHierarchy() );
      factoryState.setConfigurationProperties( cfg.getProperties() );
      factoryState.setServiceManager( new ServiceManager( cfg ) );
      factoryState.setAllIndexesManager( new IndexManagerHolder() );
      factoryState.setErrorHandler( createErrorHandler( cfg ) );
      factoryState.setInstanceInitializer( cfg.getInstanceInitializer() );
View Full Code Here

  private void initDocumentBuilders(SearchConfiguration cfg, BuildContext buildContext) {
    ConfigContext context = new ConfigContext( cfg );

    initProgrammaticAnalyzers( context, cfg.getReflectionManager() );
    initProgrammaticallyDefinedFilterDef( cfg.getReflectionManager() );
    final PolymorphicIndexHierarchy indexingHierarchy = factoryState.getIndexHierarchy();
    final Map<Class<?>, EntityIndexBinder> documentBuildersIndexedEntities = factoryState.getIndexBindingForEntity();
    final Map<Class<?>, DocumentBuilderContainedEntity<?>> documentBuildersContainedEntities = factoryState.getDocumentBuildersContainedEntities();
    final Set<XClass> optimizationBlackListedTypes = new HashSet<XClass>();
    final Map<XClass, Class> classMappings = initializeClassMappings( cfg, cfg.getReflectionManager() );
   
    //we process the @Indexed classes last, so we first start all IndexManager(s).
    final List<XClass> rootIndexedEntities = new LinkedList<XClass>();
   
    for ( Map.Entry<XClass, Class> mapping : classMappings.entrySet() ) {

      XClass mappedXClass = mapping.getKey();
      Class mappedClass = mapping.getValue();
     
      if ( mappedXClass.isAnnotationPresent( Indexed.class ) ) {

        if ( mappedXClass.isAbstract() ) {
          log.abstractClassesCannotInsertDocuments();
          continue;
        }

        rootIndexedEntities.add( mappedXClass );
        indexingHierarchy.addIndexedClass( mappedClass );
      }
      else {
        //FIXME DocumentBuilderIndexedEntity needs to be built by a helper method receiving Class<T> to infer T properly
        //XClass unfortunately is not (yet) genericized: TODO?
        final DocumentBuilderContainedEntity<?> documentBuilder = new DocumentBuilderContainedEntity(
View Full Code Here

      //set the mutable structure of factory state
      rootFactory = new MutableSearchFactory();
      factoryState.setDocumentBuildersIndexedEntities( new ConcurrentHashMap<Class<?>, EntityIndexBinder<?>>() );
      factoryState.setDocumentBuildersContainedEntities( new ConcurrentHashMap<Class<?>, DocumentBuilderContainedEntity<?>>() );
      factoryState.setFilterDefinitions( new ConcurrentHashMap<String, FilterDef>() );
      factoryState.setIndexHierarchy( new PolymorphicIndexHierarchy() );
      factoryState.setConfigurationProperties( cfg.getProperties() );
      factoryState.setServiceManager( new ServiceManager( cfg ) );
      factoryState.setAllIndexesManager( new IndexManagerHolder() );
      factoryState.setErrorHandler( createErrorHandler( cfg ) );
      factoryState.setClassHelper( cfg.getClassHelper() );
View Full Code Here

  private void initDocumentBuilders(SearchConfiguration cfg, ReflectionManager reflectionManager, BuildContext buildContext) {
    ConfigContext context = new ConfigContext( cfg );

    initProgrammaticAnalyzers( context, reflectionManager );
    initProgrammaticallyDefinedFilterDef( reflectionManager );
    final PolymorphicIndexHierarchy indexingHierarchy = factoryState.getIndexHierarchy();
    final Map<Class<?>, EntityIndexBinder<?>> documentBuildersIndexedEntities = factoryState.getIndexBindingForEntity();
    final Map<Class<?>, DocumentBuilderContainedEntity<?>> documentBuildersContainedEntities = factoryState.getDocumentBuildersContainedEntities();
    final Set<XClass> optimizationBlackListedTypes = new HashSet<XClass>();
    final Map<XClass, Class> classMappings = initializeClassMappings( cfg, reflectionManager );
   
    //we process the @Indexed classes last, so we first start all IndexManager(s).
    final List<XClass> rootIndexedEntities = new LinkedList<XClass>();
   
    for ( Map.Entry<XClass, Class> mapping : classMappings.entrySet() ) {

      XClass mappedXClass = mapping.getKey();
      Class mappedClass = mapping.getValue();
     
      if ( mappedXClass.isAnnotationPresent( Indexed.class ) ) {

        if ( mappedXClass.isAbstract() ) {
          log.abstractClassesCannotInsertDocuments();
          continue;
        }

        rootIndexedEntities.add( mappedXClass );
        indexingHierarchy.addIndexedClass( mappedClass );
      }
      else {
        //FIXME DocumentBuilderIndexedEntity needs to be built by a helper method receiving Class<T> to infer T properly
        //XClass unfortunately is not (yet) genericized: TODO?
        final DocumentBuilderContainedEntity<?> documentBuilder = new DocumentBuilderContainedEntity(
View Full Code Here

      rootFactory = new MutableSearchFactory();
      factoryState.setDocumentBuildersIndexedEntities( new HashMap<Class<?>, DocumentBuilderIndexedEntity<?>>() );
      factoryState.setDocumentBuildersContainedEntities( new HashMap<Class<?>, DocumentBuilderContainedEntity<?>>() );
      factoryState.setDirectoryProviderData( new HashMap<DirectoryProvider<?>, DirectoryProviderData>() );
      factoryState.setFilterDefinitions( new HashMap<String, FilterDef>() );
      factoryState.setIndexHierarchy( new PolymorphicIndexHierarchy() );
      factoryState.setConfigurationProperties( cfg.getProperties() );
      factoryState.setErrorHandler( createErrorHandler( factoryState.getConfigurationProperties() ) );
      factoryState.setServiceManager( new ServiceManager( cfg ) );
    }
  }
View Full Code Here

TOP

Related Classes of org.hibernate.search.spi.internals.PolymorphicIndexHierarchy

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.