congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ConfigurationPropertyReader.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.hibernate.ogm.util.configurationreader.spi.ConfigurationPropertyReader
constructor

Best Java code snippets using org.hibernate.ogm.util.configurationreader.spi.ConfigurationPropertyReader.<init> (Showing top 20 results out of 315)

origin: org.hibernate.ogm/hibernate-ogm-couchdb

@Override
public void configure(Map configurationValues) {
  configuration = new CouchDBConfiguration( new ConfigurationPropertyReader( configurationValues ) );
}
origin: hibernate/hibernate-ogm

@Override
public void configure(Map configurationValues) {
  configuration = new RemoteNeo4jConfiguration( new ConfigurationPropertyReader( configurationValues ), defaultPort );
  sequenceCacheMaxSize = new ConfigurationPropertyReader( configurationValues )
      .property( Neo4jProperties.SEQUENCE_QUERY_CACHE_MAX_SIZE, int.class )
      .withDefault( DEFAULT_SEQUENCE_QUERY_CACHE_MAX_SIZE )
      .getValue();
}
origin: org.hibernate.ogm/hibernate-ogm-ehcache

/**
 * 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();
}
origin: hibernate/hibernate-ogm

  /**
   * Decides if we need to start OGM when {@link OgmProperties#ENABLED} is not set.
   * At the moment, if a dialect class is not declared, Hibernate ORM requires a datasource or a JDBC connector when a dialect is not declared.
   * If none of those properties are declared, we assume the user wants to start Hibernate OGM.
   *
   * @param settings
   * @return {@code true} if we have to start OGM, {@code false} otherwise
   */
  private boolean isOgmImplicitEnabled(Map<?, ?> settings) {
    String jdbcUrl = new ConfigurationPropertyReader( settings )
        .property( Environment.URL, String.class )
        .getValue();

    String jndiDatasource = new ConfigurationPropertyReader( settings )
        .property( Environment.DATASOURCE, String.class )
        .getValue();

    String dialect = new ConfigurationPropertyReader( settings )
        .property( Environment.DIALECT, String.class )
        .getValue();

    return jdbcUrl == null && jndiDatasource == null && dialect == null;
  }
}
origin: hibernate/hibernate-ogm

@Override
public void configure(Map configurationValues) {
  ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class );
  ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationValues, classLoaderService );
  sessionFactoryOptions = new OptionsServiceContextImpl( OptionValueSources.getDefaultSources( propertyReader ) );
}
origin: hibernate/hibernate-ogm

private boolean isOgmEnabled(Map<?, ?> settings) {
  Boolean ogmEnabled = new ConfigurationPropertyReader( settings )
    .property( OgmProperties.ENABLED, Boolean.class )
    .getValue();
  if ( ogmEnabled == null ) {
    return isOgmImplicitEnabled( settings );
  }
  return ogmEnabled;
}
origin: hibernate/hibernate-ogm

@Override
public void initialize(Map<?, ?> properties) {
  ConfigurationPropertyReader configurationPropertyReader = new ConfigurationPropertyReader( properties );
  String path = configurationPropertyReader.property( Neo4jProperties.DATABASE_PATH, String.class )
      .required()
      .getValue();
  this.dbLocation = new File( path );
  this.configurationLocation = configurationPropertyReader
      .property( Neo4jProperties.CONFIGURATION_RESOURCE_NAME, URL.class )
      .getValue();
  configuration = properties;
}
origin: hibernate/hibernate-ogm

  private ErrorHandler getErrorHandler(Map<?, ?> configurationValues, ServiceRegistryImplementor registry) {
    ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationValues, registry.getService( ClassLoaderService.class ) );

    return propertyReader.property( OgmProperties.ERROR_HANDLER, ErrorHandler.class ).instantiate().getValue();
  }
}
origin: hibernate/hibernate-ogm

  /**
   * Initialize the internal values form the given {@link Map}.
   *
   * @param configurationMap
   *            The values to use as configuration
   */
  public void initConfiguration(Map<?, ?> configurationMap) {
    ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationMap );

    this.configUrl = propertyReader
        .property( InfinispanProperties.CONFIGURATION_RESOURCE_NAME, URL.class )
        .withDefault( InfinispanConfiguration.class.getClassLoader().getResource( INFINISPAN_DEFAULT_CONFIG ) )
        .getValue();

    this.jndi = propertyReader
        .property( InfinispanProperties.CACHE_MANAGER_JNDI_NAME, String.class )
        .getValue();

    log.tracef( "Initializing Infinispan from configuration file at %1$s", configUrl );
  }
}
origin: org.hibernate.ogm/hibernate-ogm-infinispan-embedded

  /**
   * Initialize the internal values form the given {@link Map}.
   *
   * @param configurationMap
   *            The values to use as configuration
   */
  public void initConfiguration(Map<?, ?> configurationMap) {
    ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationMap );

    this.configUrl = propertyReader
        .property( InfinispanProperties.CONFIGURATION_RESOURCE_NAME, URL.class )
        .withDefault( InfinispanConfiguration.class.getClassLoader().getResource( INFINISPAN_DEFAULT_CONFIG ) )
        .getValue();

    this.jndi = propertyReader
        .property( InfinispanProperties.CACHE_MANAGER_JNDI_NAME, String.class )
        .getValue();

    log.tracef( "Initializing Infinispan from configuration file at %1$s", configUrl );
  }
}
origin: hibernate/hibernate-ogm

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

    factory.initialize( properties );

    return factory;
  }
}
origin: hibernate/hibernate-ogm

@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();
  log.useDatastoreProvider( datastoreProvider.getClass() );
  return datastoreProvider;
}
origin: org.hibernate.ogm/hibernate-ogm-cassandra

@Override
public void configure(Map configurationValues) {
  OptionsService optionsService = serviceRegistry.getService( OptionsService.class );
  ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
  ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader(
      configurationValues,
      classLoaderService
  );
  config = new CassandraConfiguration( propertyReader, optionsService.context().getGlobalOptions() );
}
origin: hibernate/hibernate-ogm

@Override
public void configure(Map cfg) {
  graphDbFactory = new EmbeddedNeo4jGraphDatabaseServiceFactoryProvider().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();
}
origin: hibernate/hibernate-ogm

@Override
public void configure(Map configurationValues) {
  OptionsService optionsService = serviceRegistry.getService( OptionsService.class );
  ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
  ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationValues, classLoaderService );
  try {
    this.config = new MongoDBConfiguration( propertyReader, optionsService.context().getGlobalOptions() );
  }
  catch (Exception e) {
    // Wrap Exception in a ServiceException to make the stack trace more friendly
    // Otherwise a generic unable to request service is thrown
    throw log.unableToConfigureDatastoreProvider( e );
  }
}
origin: org.hibernate.ogm/hibernate-ogm-mongodb

@Override
public void configure(Map configurationValues) {
  OptionsService optionsService = serviceRegistry.getService( OptionsService.class );
  ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
  ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationValues, classLoaderService );
  try {
    this.config = new MongoDBConfiguration( propertyReader, optionsService.context().getGlobalOptions() );
  }
  catch (Exception e) {
    // Wrap Exception in a ServiceException to make the stack trace more friendly
    // Otherwise a generic unable to request service is thrown
    throw log.unableToConfigureDatastoreProvider( e );
  }
}
origin: hibernate/hibernate-ogm

@Override
public GridDialect initiateService(Map configurationValues, ServiceRegistryImplementor registry) {
  DatastoreProvider datastore = registry.getService( DatastoreProvider.class );
  boolean errorHandlerConfigured = configurationValues.containsKey( OgmProperties.ERROR_HANDLER );
  EventContextManager eventContext = registry.getService( EventContextManager.class );
  ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationValues, registry.getService( ClassLoaderService.class ) );
  return ( (DefaultClassPropertyReaderContext<GridDialect>) propertyReader.property( OgmProperties.GRID_DIALECT, GridDialect.class )
      .instantiate() )
      .withDefaultImplementation( registry.getService( DatastoreProvider.class ).getDefaultDialect() )
      .withInstantiator( new GridDialectInstantiator( datastore, errorHandlerConfigured, eventContext ) )
      .getValue();
}
origin: org.hibernate.ogm/hibernate-ogm-ignite

/**
 * Initialize the internal values from the given {@link Map}.
 *
 * @param configurationMap The values to use as configuration
 */
public void initialize(Map configurationMap, ClassLoaderService classLoaderService) {
  ConfigurationPropertyReader configurationPropertyReader = new ConfigurationPropertyReader( configurationMap, classLoaderService );
  this.url = configurationPropertyReader
    .property( IgniteProperties.CONFIGURATION_RESOURCE_NAME, URL.class )
    .withDefault( IgniteProviderConfiguration.class.getClassLoader().getResource( DEFAULT_CONFIG ) )
    .getValue();
  String configBuilderClassName = configurationPropertyReader
      .property( IgniteProperties.CONFIGURATION_CLASS_NAME, String.class )
      .getValue();
  if ( configBuilderClassName != null ) {
    this.configBuilder = configurationPropertyReader
        .property( IgniteProperties.CONFIGURATION_CLASS_NAME, IgniteConfigurationBuilder.class )
        .instantiate()
        .getValue();
  }
  this.instanceName = configurationPropertyReader
      .property( IgniteProperties.IGNITE_INSTANCE_NAME, String.class )
      .getValue();
}
origin: hibernate/hibernate-ogm

  @Override
  public QueryParserService initiateService(SessionFactoryImplementor sessionFactory, SessionFactoryOptions sessionFactoryOptions, ServiceRegistryImplementor registry) {
    ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader(
        registry.getService( ConfigurationService.class ).getSettings(),
        registry.getService( ClassLoaderService.class )
    );

    return propertyReader.property( InternalProperties.QUERY_PARSER_SERVICE, QueryParserService.class )
        .instantiate()
        .withDefaultImplementation( registry.getService( DatastoreProvider.class ).getDefaultQueryParserServiceType() )
        .getValue();
  }
}
origin: org.hibernate.ogm/hibernate-ogm-infinispan-remote

ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationMap, classLoaderService );
org.hibernate.ogm.util.configurationreader.spiConfigurationPropertyReader<init>

Popular methods of ConfigurationPropertyReader

  • property

Popular in Java

  • Parsing JSON documents to java classes using gson
  • runOnUiThread (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • setContentView (Activity)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • JOptionPane (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now