Package org.hibernate.ogm.util.configurationreader.impl

Examples of org.hibernate.ogm.util.configurationreader.impl.ConfigurationPropertyReader


  }


  @Override
  public DatastoreProvider initiateService(Map configurationValues, ServiceRegistryImplementor registry) {
    ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationValues, registry.getService( ClassLoaderService.class ) );

    DatastoreProvider datastoreProvider = propertyReader.property( OgmProperties.DATASTORE_PROVIDER, DatastoreProvider.class )
        .instantiate()
        .withDefaultImplementation( DEFAULT_DATASTORE_PROVIDER )
        .withShortNameResolver( DatastoreProviderShortNameResolver.INSTANCE )
        .getValue();
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();
View Full Code Here

public class ConfigurationService implements Service {

  private final boolean isOn;

  public ConfigurationService(Map config) {
    isOn = new ConfigurationPropertyReader( config )
      .property( InternalProperties.OGM_ON, boolean.class )
      .withDefault( false )
      .getValue();
  }
View Full Code Here

    return QueryParserService.class;
  }

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

    return propertyReader.property( InternalProperties.QUERY_PARSER_SERVICE, QueryParserService.class )
        .instantiate()
        .withDefaultImplementation( registry.getService( DatastoreProvider.class ).getDefaultQueryParserServiceType() )
        .getValue();
  }
View Full Code Here

  }

  @Override
  public GridDialect initiateService(Map configurationValues, ServiceRegistryImplementor registry) {
    DatastoreProvider datastore = registry.getService( DatastoreProvider.class );
    ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationValues, registry.getService( ClassLoaderService.class ) );

    return propertyReader.property( OgmProperties.GRID_DIALECT, GridDialect.class )
        .instantiate()
        .withDefaultImplementation( registry.getService( DatastoreProvider.class ).getDefaultDialect() )
        .withInstantiator( new GridDialectInstantiator( datastore, registry ) )
        .getValue();
  }
View Full Code Here

  }

  @Override
  public void configure(Map configurationValues) {
    ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class );
    ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationValues, classLoaderService );

    sessionFactoryOptions = new OptionsServiceContextImpl( OptionValueSources.getDefaultSources( propertyReader ) );
  }
View Full Code Here

* @author Davide D'Alto <davide@hibernate.org>
*/
public class Neo4jGraphDatabaseServiceFactoryProvider {

  public GraphDatabaseServiceFactory load(Map<?, ?> properties, ClassLoaderService classLoaderService) {
    GraphDatabaseServiceFactory factory = new ConfigurationPropertyReader(properties, classLoaderService )
      .property( InternalProperties.NEO4J_GRAPHDB_FACTORYCLASS, GraphDatabaseServiceFactory.class )
      .instantiate()
      .withDefaultImplementation( EmbeddedGraphDatabaseFactory.class )
      .getValue();

View Full Code Here

  }

  @Override
  public void configure(Map cfg) {
    graphDbFactory = new Neo4jGraphDatabaseServiceFactoryProvider().load( cfg, registry.getService( ClassLoaderService.class ) );
    sequenceCacheMaxSize = new ConfigurationPropertyReader( cfg )
      .property( Neo4jProperties.SEQUENCE_QUERY_CACHE_MAX_SIZE, int.class )
      .withDefault( DEFAULT_SEQUENCE_QUERY_CACHE_MAX_SIZE )
      .getValue();
  }
View Full Code Here

* @author Davide D'Alto <davide@hibernate.org>
*/
public class Neo4jGraphDatabaseServiceFactoryProvider {

  public GraphDatabaseServiceFactory load(Map<?, ?> properties, ClassLoaderService classLoaderService) {
    GraphDatabaseServiceFactory factory = new ConfigurationPropertyReader(properties, classLoaderService )
      .property( InternalProperties.NEO4J_GRAPHDB_FACTORYCLASS, GraphDatabaseServiceFactory.class )
      .instantiate()
      .withDefaultImplementation( EmbeddedGraphDatabaseFactory.class )
      .getValue();

View Full Code Here

  private Map<?, ?> configuration;

  @Override
  public void initialize(Map<?, ?> properties) {
    ConfigurationPropertyReader configurationPropertyReader = new ConfigurationPropertyReader( properties );

    this.dbLocation = configurationPropertyReader.property( Neo4jProperties.DATABASE_PATH, String.class )
        .required()
        .getValue();

    this.configurationLocation = configurationPropertyReader
        .property( Neo4jProperties.CONFIGURATION_RESOURCE_NAME, URL.class )
        .getValue();

    configuration = properties;
  }
View Full Code Here

TOP

Related Classes of org.hibernate.ogm.util.configurationreader.impl.ConfigurationPropertyReader

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.