Examples of MutableSearchFactory


Examples of org.hibernate.search.impl.MutableSearchFactory

  }

  private void createCleanFactoryState(SearchConfiguration cfg) {
    if ( rootFactory == null ) {
      //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() );
View Full Code Here

Examples of org.hibernate.search.impl.MutableSearchFactory

  }

  private void createCleanFactoryState() {
    if ( rootFactory == null ) {
      //set the mutable structure of factory state
      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() );
View Full Code Here

Examples of org.hibernate.search.impl.MutableSearchFactory

  }

  private void createCleanFactoryState(SearchConfiguration cfg) {
    if ( rootFactory == null ) {
      //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() );
View Full Code Here

Examples of org.hibernate.search.impl.MutableSearchFactory

  }

  private void createCleanFactoryState(SearchConfiguration cfg) {
    if ( rootFactory == null ) {
      //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() );
View Full Code Here

Examples of org.hibernate.search.impl.MutableSearchFactory

  }

  private void createCleanFactoryState(SearchConfiguration cfg) {
    if ( rootFactory == null ) {
      //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() );
View Full Code Here

Examples of org.hibernate.search.impl.MutableSearchFactory

  }

  private void createCleanFactoryState(SearchConfiguration cfg) {
    if ( rootFactory == null ) {
      //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() );
View Full Code Here

Examples of org.hibernate.search.impl.MutableSearchFactory

  private JChannel[] channels;
  private short muxId;

  @Test
  public void testMuxDispatcher() throws Exception {
    MutableSearchFactory searchFactory = (MutableSearchFactory) getSearchFactory();
    MessageSenderService sender = searchFactory.getServiceManager().requestService( MessageSenderService.class );
    Assert.assertNotNull( sender );
    String className = sender.getClass().getName();
    Assert.assertTrue( "Wrong sender instance: " + className, className.contains( "DispatchMessageSender" ) );
  }
View Full Code Here

Examples of org.hibernate.search.impl.MutableSearchFactory

  private JChannel masterChannel;
  private JChannel slaveChannel;

  @Test
  public void testInjectionHappened() throws Exception {
    MutableSearchFactory searchFactory = (MutableSearchFactory) getSearchFactory();
    MessageSenderService sender = searchFactory.getServiceManager().requestService( MessageSenderService.class );
    Assert.assertTrue( masterChannel.getAddress().equals( sender.getAddress() ) );
  }
View Full Code Here

Examples of org.hibernate.search.impl.MutableSearchFactory

      .property( "id", ElementType.FIELD ).documentId()
      .property( "title", ElementType.FIELD ).field()
      ;
    cfg.setProgrammaticMapping( mapping );
    cfg.addClass( Document.class );
    MutableSearchFactory sf = (MutableSearchFactory) new SearchFactoryBuilder().configuration( cfg ).buildSearchFactory();
    try {
      assertEquals( expectation, extractWorkspace( sf, Document.class ).areSingleTermDeletesSafe() );

      // trigger a SearchFactory rebuild:
      sf.addClasses( Dvd.class, Book.class );
      // DVD share the same index, so now it's always unsafe [always false no matter the global option]
      assertEquals( false, extractWorkspace( sf, Dvd.class ).areSingleTermDeletesSafe() );
      assertEquals( false, extractWorkspace( sf, Document.class ).areSingleTermDeletesSafe() );

      // but still as expected for Book :
      assertEquals( expectation, extractWorkspace( sf, Book.class ).areSingleTermDeletesSafe() );
    }
    finally {
      sf.close();
    }
  }
View Full Code Here

Examples of org.hibernate.search.impl.MutableSearchFactory

      .property( "id", ElementType.FIELD ).documentId()
      .property( "title", ElementType.FIELD ).field()
      ;
    cfg.setProgrammaticMapping( mapping );
    cfg.addClass( Document.class );
    MutableSearchFactory sf = (MutableSearchFactory) new SearchFactoryBuilder().configuration( cfg ).buildSearchFactory();
    try {
      Assert.assertEquals( expectation, sf.isTransactionManagerExpected() );
      // trigger a SearchFactory rebuild:
      sf.addClasses( Dvd.class );
      // and verify the option is not lost:
      Assert.assertEquals( expectation, sf.isTransactionManagerExpected() );
    }
    finally {
      sf.close();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.