Package org.hibernate.search.backend.spi

Examples of org.hibernate.search.backend.spi.Worker


      Collection<Work<Object>> works = searchWorkCreator.createPerEntityWorks(value, id, workType);
      performSearchWorks(works, transactionContext);
   }

   private <T> void performSearchWorks(Collection<Work<T>> works, TransactionContext transactionContext) {
      Worker worker = searchFactory.getWorker();
      for (Work<T> work : works) {
         worker.performWork(work, transactionContext);
      }
   }
View Full Code Here


      Collection<Work<Object>> works = searchWorkCreator.createPerEntityWorks(value, id, workType);
      performSearchWorks(works, transactionContext);
   }

   private <T> void performSearchWorks(Collection<Work<T>> works, TransactionContext transactionContext) {
      Worker worker = searchFactory.getWorker();
      for (Work<T> work : works) {
         worker.performWork(work, transactionContext);
      }
   }
View Full Code Here

  }

  public static Worker createWorker(SearchConfiguration cfg, WorkerBuildContext context, QueueingProcessor queueingProcessor) {
    Properties props = getProperties( cfg );
    String impl = props.getProperty( Environment.WORKER_SCOPE );
    Worker worker;
    if ( StringHelper.isEmpty( impl ) || "transaction".equalsIgnoreCase( impl ) ) {
      worker = new TransactionalWorker();
    }
    else {
      worker = ClassLoaderHelper.instanceFromName( Worker.class, impl, WorkerFactory.class, "worker" );
    }
    worker.initialize( props, context, queueingProcessor );
    return worker;
  }
View Full Code Here

  }

  public static Worker createWorker(SearchConfiguration cfg, WorkerBuildContext context, QueueingProcessor queueingProcessor) {
    Properties props = getProperties( cfg );
    String impl = props.getProperty( Environment.WORKER_SCOPE );
    Worker worker;
    if ( StringHelper.isEmpty( impl ) ) {
      worker = new TransactionalWorker();
    }
    else if ( "transaction".equalsIgnoreCase( impl ) ) {
      worker = new TransactionalWorker();
    }
    else {
      worker = ClassLoaderHelper.instanceFromName(
          Worker.class,
          impl, WorkerFactory.class, "worker"
      );
    }
    worker.initialize( props, context, queueingProcessor );
    return worker;
  }
View Full Code Here

      Collection<Work> works = searchWorkCreator.createPerEntityWorks(value, id, workType);
      performSearchWorks(works, transactionContext);
   }

   private void performSearchWorks(Collection<Work> works, TransactionContext transactionContext) {
      Worker worker = searchFactory.getWorker();
      for (Work work : works) {
         worker.performWork(work, transactionContext);
      }
   }
View Full Code Here

  public static Worker createWorker(SearchConfiguration searchConfiguration,
      WorkerBuildContext buildContext,
      QueueingProcessor queueingProcessor) {
    Properties properties = getProperties( searchConfiguration );
    String workerImplClassName = properties.getProperty( Environment.WORKER_SCOPE );
    Worker worker;
    if ( StringHelper.isEmpty( workerImplClassName ) || "transaction".equalsIgnoreCase( workerImplClassName ) ) {
      worker = new TransactionalWorker();
    }
    else {
      worker = instantiateExplicitlyConfiguredWorker( buildContext, workerImplClassName );
    }
    worker.initialize( properties, buildContext, queueingProcessor );
    return worker;
  }
View Full Code Here

      Collection<Work<Object>> works = searchWorkCreator.createPerEntityWorks(value, id, workType);
      performSearchWorks(works, transactionContext);
   }

   private <T> void performSearchWorks(Collection<Work<T>> works, TransactionContext transactionContext) {
      Worker worker = searchFactory.getWorker();
      for (Work<T> work : works) {
         worker.performWork(work, transactionContext);
      }
   }
View Full Code Here

      this.threadId = threadId;
    }

    @Override
    public void run() {
      final Worker worker = searchFactory.getWorker();
      final String title = "Volume N' " + Integer.toString( threadId );
      final Integer bookId = Integer.valueOf( threadId );
      final Query query = new TermQuery( new Term( "title", title ) );
      try {
        while ( running.get() ) {
View Full Code Here

  }

  public static Worker createWorker(SearchConfiguration cfg, WorkerBuildContext context, QueueingProcessor queueingProcessor) {
    Properties props = getProperties( cfg );
    String impl = props.getProperty( Environment.WORKER_SCOPE );
    Worker worker;
    if ( StringHelper.isEmpty( impl ) || "transaction".equalsIgnoreCase( impl ) ) {
      worker = new TransactionalWorker();
    }
    else {
      worker = ClassLoaderHelper.instanceFromName( Worker.class, impl, WorkerFactory.class, "worker" );
    }
    worker.initialize( props, context, queueingProcessor );
    return worker;
  }
View Full Code Here

      Collection<Work> works = searchWorkCreator.createPerEntityWorks(value, id, workType);
      performSearchWorks(works, transactionContext);
   }

   private void performSearchWorks(Collection<Work> works, TransactionContext transactionContext) {
      Worker worker = searchFactory.getWorker();
      for (Work work : works) {
         worker.performWork(work, transactionContext);
      }
   }
View Full Code Here

TOP

Related Classes of org.hibernate.search.backend.spi.Worker

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.