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

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


  public CouchDBDatastoreProvider() {
  }

  @Override
  public void configure(Map configurationValues) {
    configuration = new CouchDBConfiguration( new ConfigurationPropertyReader( configurationValues ) );
  }
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

  private final ParameterMetadataBuilder parameterMetadataBuilder;

  public NoSqlQueryParameterMetadataCache(SessionFactoryImplementor factory) {
    this.sessionFactory = factory;

    Integer maxParameterMetadataCount = new ConfigurationPropertyReader( factory.getProperties() )
        .property( Environment.QUERY_PLAN_CACHE_PARAMETER_METADATA_MAX_SIZE, int.class )
        .withDefault( QueryPlanCache.DEFAULT_PARAMETER_METADATA_MAX_COUNT )
        .getValue();

    parameterMetadataCache = new BoundedConcurrentHashMap<String, ParameterMetadata>(
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

    return DatastoreProvider.class;
  }

  @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();
View Full Code Here

  }

  @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() )
        .withInstantiator( new GridDialectInstantiator( datastore, registry ) )
        .getValue();
  }
View Full Code Here

   * Initialize the internal values from the given {@link Map}.
   *
   * @param configurationMap The values to use as configuration
   */
  public void initialize(Map configurationMap) {
    this.url = new ConfigurationPropertyReader( configurationMap )
      .property( EhcacheProperties.CONFIGURATION_RESOURCE_NAME, URL.class )
      .withDefault( EhcacheConfiguration.class.getClassLoader().getResource( DEFAULT_CONFIG ) )
      .getValue();
  }
View Full Code Here

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

    this.config = new MongoDBConfiguration( propertyReader, optionsService.context().getGlobalOptions() );
  }
View Full Code Here

  private final WriteConcern writeConcern;

  public MongoDBConfiguration(Map<?, ?> configurationValues) {
    super( configurationValues, DEFAULT_PORT );

    ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationValues );

    this.timeout = propertyReader.property( MongoDBProperties.TIMEOUT, int.class )
        .withDefault( DEFAULT_TIMEOUT )
        .withValidator( TIMEOUT_VALIDATOR )
        .getValue();

    this.associationDocumentStorage = propertyReader.property( MongoDBProperties.ASSOCIATION_DOCUMENT_STORAGE, AssociationDocumentType.class )
        .withDefault( AssociationDocumentType.GLOBAL_COLLECTION )
        .getValue();

    this.writeConcern = this.buildWriteConcern( configurationValues );
  }
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.