Package org.hibernate.ogm.datastore.spi

Examples of org.hibernate.ogm.datastore.spi.DatastoreProvider


  }

  @Override
  public void configure(Map configurationValues) {
    GridDialectFactoryImpl dialectFactory = serviceRegistry.getService(GridDialectFactoryImpl.class);
    DatastoreProvider datastoreProvider = serviceRegistry.getService(DatastoreProvider.class);
    this.gridDialect = dialectFactory.buildGridDialect(configurationValues, serviceRegistry);
    this.serviceRegistry = null;
  }
View Full Code Here


    // (Comment by Emmanuel)
  }

  protected final MapDatastoreProvider getProvider(SessionImplementor session) {
    if ( provider == null ) {
      DatastoreProvider service = session.getFactory().getServiceRegistry().getService(DatastoreProvider.class);
      if ( service instanceof MapDatastoreProvider ) {
        provider = (MapDatastoreProvider) service;
      }
      else {
        log.unexpectedDatastoreProvider(service.getClass(), MapDatastoreProvider.class);
      }
    }
    return provider;
  }
View Full Code Here

    // (Comment by Emmanuel)
  }

  protected final MapDatastoreProvider getProvider(SessionImplementor session) {
    if ( provider == null ) {
      DatastoreProvider service = session.getFactory().getServiceRegistry().getService( DatastoreProvider.class );
      if ( service instanceof MapDatastoreProvider ) {
        provider = (MapDatastoreProvider) service;
      }
      else {
        log.unexpectedDatastoreProvider( service.getClass(), MapDatastoreProvider.class );
      }
    }
    return provider;
  }
View Full Code Here

    //FIXME check the version number as well and raise an optimistic lock exception if there is an issue JPA 2 spec: 3.4.4.2
  }

  private InfinispanDatastoreProvider getProvider(SessionImplementor session) {
    if ( provider == null ) {
      DatastoreProvider service = session.getFactory().getServiceRegistry().getService( DatastoreProvider.class );
      if ( service instanceof InfinispanDatastoreProvider ) {
        provider = InfinispanDatastoreProvider.class.cast( service );
      }
      else {
        log.unexpectedDatastoreProvider( service.getClass(), InfinispanDatastoreProvider.class );
      }
    }
    return provider;
  }
View Full Code Here

    //FIXME check the version number as well and raise an optimistic lock exception if there is an issue JPA 2 spec: 3.4.4.2
  }

  private InfinispanDatastoreProvider getProvider(SessionImplementor session) {
    if ( provider == null ) {
      DatastoreProvider service = session.getFactory().getServiceRegistry().getService( DatastoreProvider.class );
      if ( service instanceof InfinispanDatastoreProvider ) {
        provider = InfinispanDatastoreProvider.class.cast( service );
      }
      else {
        log.unexpectedDatastoreProvider( service.getClass(), InfinispanDatastoreProvider.class );
      }
    }
    return provider;
  }
View Full Code Here

    //FIXME check the version number as well and raise an optimistic lock exception if there is an issue JPA 2 spec: 3.4.4.2
  }

  private InfinispanDatastoreProvider getProvider(SessionImplementor session) {
    if ( provider == null ) {
      DatastoreProvider service = session.getFactory().getServiceRegistry().getService( DatastoreProvider.class );
      if ( service instanceof InfinispanDatastoreProvider ) {
        provider = InfinispanDatastoreProvider.class.cast( service );
      }
      else {
        log.unexpectedDatastoreProvider( service.getClass(), InfinispanDatastoreProvider.class );
      }
    }
    return provider;
  }
View Full Code Here

    //FIXME check the version number as well and raise an optimistic lock exception if there is an issue JPA 2 spec: 3.4.4.2
  }

  private InfinispanDatastoreProvider getProvider(SessionImplementor session) {
    if ( provider == null ) {
      DatastoreProvider service = session.getFactory().getServiceRegistry().getService( DatastoreProvider.class );
      if ( service instanceof InfinispanDatastoreProvider ) {
        provider = InfinispanDatastoreProvider.class.cast( service );
      }
      else {
        log.unexpectedDatastoreProvider( service.getClass(), InfinispanDatastoreProvider.class );
      }
    }
    return provider;
  }
View Full Code Here

    return GridDialect.class;
  }

  @Override
  public GridDialect initiateService(SessionFactoryImplementor sessionFactory, Configuration configuration, ServiceRegistryImplementor registry) {
    DatastoreProvider datastore = registry.getService( DatastoreProvider.class );
    ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configuration, registry.getService( ClassLoaderService.class ) );

    return propertyReader.property( OgmProperties.GRID_DIALECT, GridDialect.class )
        .instantiate()
        .withDefaultImplementation( registry.getService( DatastoreProvider.class ).getDefaultDialect() )
View Full Code Here

    return new JBossStandAloneJtaPlatform();
  }

  //TODO OGM-370 get rid of this!!!
  private boolean isNeo4j(Map configuration, ClassLoaderService classLoaderService) {
    DatastoreProvider configuredProvider = new ConfigurationPropertyReader( configuration, classLoaderService )
      .property( OgmProperties.DATASTORE_PROVIDER, DatastoreProvider.class )
      .instantiate()
      .withShortNameResolver( new DatastoreProviderInitiator.DatastoreProviderShortNameResolver() )
      .getValue();

    return configuredProvider != null &&
        configuredProvider.getClass().getName().equals(
            AvailableDatastoreProvider.NEO4J_EMBEDDED.getDatastoreProviderClassName() );
  }
View Full Code Here

  @Override
  public DatastoreProvider initiateService(SessionFactoryImplementor sessionFactory, Configuration configuration, ServiceRegistryImplementor registry) {
    ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configuration, registry.getService( ClassLoaderService.class ) );

    DatastoreProvider datastoreProvider = propertyReader.property( OgmProperties.DATASTORE_PROVIDER, DatastoreProvider.class )
        .instantiate()
        .withDefaultImplementation( DEFAULT_DATASTORE_PROVIDER )
        .withShortNameResolver( DatastoreProviderShortNameResolver.INSTANCE )
        .getValue();

    log.useDatastoreProvider( datastoreProvider.getClass().getName() );
    return datastoreProvider;
  }
View Full Code Here

TOP

Related Classes of org.hibernate.ogm.datastore.spi.DatastoreProvider

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.