@Override public void configure(Map configurationValues) { configuration = new CouchDBConfiguration( new ConfigurationPropertyReader( configurationValues ) ); }
@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(); }
/** * 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(); }
/** * 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; } }
@Override public void configure(Map configurationValues) { ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class ); ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationValues, classLoaderService ); sessionFactoryOptions = new OptionsServiceContextImpl( OptionValueSources.getDefaultSources( propertyReader ) ); }
private boolean isOgmEnabled(Map<?, ?> settings) { Boolean ogmEnabled = new ConfigurationPropertyReader( settings ) .property( OgmProperties.ENABLED, Boolean.class ) .getValue(); if ( ogmEnabled == null ) { return isOgmImplicitEnabled( settings ); } return ogmEnabled; }
@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; }
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(); } }
/** * 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 ); } }
/** * 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 ); } }
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; } }
@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; }
@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() ); }
@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(); }
@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 ); } }
@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 ); } }
@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(); }
/** * 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(); }
@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(); } }
ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationMap, classLoaderService );