Package org.hibernate.search.engine.service.spi

Examples of org.hibernate.search.engine.service.spi.ServiceManager


      else {
        shardingStrategy = new IdHashShardingStrategy();
      }
    }
    else {
      ServiceManager serviceManager = buildContext.getServiceManager();
      shardingStrategy = ClassLoaderHelper.instanceFromName(
          IndexShardingStrategy.class,
          shardingStrategyName,
          "IndexShardingStrategy",
          serviceManager
View Full Code Here


  public static DirectoryProvider<?> createDirectoryProvider(String directoryProviderName, Properties indexProps, WorkerBuildContext context) {
    String className = indexProps.getProperty( "directory_provider", "" );
    String maybeShortCut = className.toLowerCase();

    DirectoryProvider<?> provider;
    ServiceManager serviceManager = context.getServiceManager();
    //try and use the built-in shortcuts before loading the provider as a fully qualified class name
    if ( defaultProviderClasses.containsKey( maybeShortCut ) ) {
      String fullClassName = defaultProviderClasses.get( maybeShortCut );
      provider = ClassLoaderHelper.instanceFromName(
          DirectoryProvider.class,
View Full Code Here

    worker.initialize( properties, buildContext, queueingProcessor );
    return worker;
  }

  private static Worker instantiateExplicitlyConfiguredWorker(WorkerBuildContext buildContext, String workerImplClassName) {
    ServiceManager serviceManager = buildContext.getServiceManager();
    return ClassLoaderHelper.instanceFromName(
        Worker.class,
        workerImplClassName,
        "worker",
        serviceManager
View Full Code Here

   */
  private volatile boolean manageCacheManager = false;

  @Override
  public void start(Properties properties, BuildContext context) {
    ServiceManager serviceManager = context.getServiceManager();
    String name = ConfigurationParseHelper.getString( properties, CACHE_MANAGER_RESOURCE_PROP, null );
    if ( name == null ) {
      // No JNDI lookup configured: start the CacheManager
      String cfgName = properties.getProperty(
          INFINISPAN_CONFIGURATION_RESOURCENAME,
View Full Code Here

        throw log.getUnableToCreateJGroupsBackendException( e );
      }
      backendQueueProcessor = createJGroupsQueueProcessor( autoNodeSelector, buildContext.getServiceManager() );
    }
    else {
      ServiceManager serviceManager = buildContext.getServiceManager();
      backendQueueProcessor = ClassLoaderHelper.instanceFromName(
          BackendQueueProcessor.class,
          backend,
          "processor",
          serviceManager
View Full Code Here

    //no queue limit
    return ConfigurationParseHelper.getIntValue( properties, Environment.WORKER_WORKQUEUE_SIZE, Integer.MAX_VALUE );
  }

  private static BackendQueueProcessor createJGroupsQueueProcessor(String selectorClass, BuildContext buildContext) {
    ServiceManager serviceManager = buildContext.getServiceManager();
    return createJGroupsQueueProcessor(
        ClassLoaderHelper.instanceFromName(
            Object.class,
            selectorClass,
            "JGroups node selector",
View Full Code Here

      throw new RuntimeException( "Animal expected but found " + entityType );
    }

    @Override
    protected Set<String> loadInitialShardNames(Properties properties, BuildContext buildContext) {
      ServiceManager serviceManager = buildContext.getServiceManager();
      SessionFactory sessionFactory = serviceManager.requestService( HibernateSessionFactoryService.class ).getSessionFactory();
      Session session = sessionFactory.openSession();
      try {
        Criteria initialShardsCriteria = session.createCriteria( Animal.class );
        initialShardsCriteria.setProjection( Projections.distinct( Property.forName( "type" ) ) );
View Full Code Here

* @author Hardy Ferentschik
*/
public class NativeJavaSerializationProviderTest {
  @Test
  public void testCorrectSerializationProviderDetected() {
    ServiceManager serviceManager = new StandardServiceManager(
        new SearchConfigurationForTest(),
        null
    );

    SerializationProvider serializationProvider = serviceManager.requestService( SerializationProvider.class );
    assertTrue( "Wrong serialization provider", serializationProvider instanceof NativeJavaSerializationProvider );
  }
View Full Code Here

*/
public class FooServiceImplWithCircularDependency implements FooService {

  @Override
  public void start(Properties properties, BuildContext context) {
    ServiceManager serviceManager = context.getServiceManager();
    // requesting service in a circular way
    serviceManager.requestService( FooService.class );
  }
View Full Code Here

      Properties indexProperties,
      WorkerBuildContext buildContext) {
    MaskedProperty maskedProperty = new MaskedProperty( indexProperties, "optimizer" );
    String optimizerImplClassName = maskedProperty.getProperty( "implementation" );
    if ( optimizerImplClassName != null && ( !"default".equalsIgnoreCase( optimizerImplClassName ) ) ) {
      ServiceManager serviceManager = buildContext.getServiceManager();
      return ClassLoaderHelper.instanceFromName(
          OptimizerStrategy.class,
          optimizerImplClassName,
          "Optimizer Strategy",
          serviceManager
View Full Code Here

TOP

Related Classes of org.hibernate.search.engine.service.spi.ServiceManager

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.