Package org.hibernate.ogm.util.configurationreader.spi

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


  public CouchDBDatastoreProvider() {
  }

  @Override
  public void configure(Map configurationValues) {
    configuration = new CouchDBConfiguration( new ConfigurationPropertyReader( configurationValues ) );
  }
View Full Code Here


  @BeforeClass
  public static void createDatabaseAndSetUpAuthentication() throws Exception {
    OgmConfiguration configuration = getConfiguration();

    ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configuration );
    host = propertyReader.property( OgmProperties.HOST, String.class ).withDefault( "localhost" ).getValue();
    port = propertyReader.property( OgmProperties.PORT, int.class ).withDefault( 5984 ).getValue();
    serverUri = "http://" + host + ":" + port;

    client = getClientWithServerAdminCredentials();

    createServerAdminUser();
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 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

    cfg.put( OgmProperties.DATABASE, "database" );

    context = new AppendableConfigurationContext();
    configuration = new MongoDB().getConfigurationBuilder( new ConfigurationContextImpl( context ) );

    reader = new ConfigurationPropertyReader( cfg, new ClassLoaderServiceImpl() );
  }
View Full Code Here

  }

  @Test(expected = HibernateException.class )
  public void shouldRaiseErrorIfStrategyIsCUSTOMButNoTypeIsGiven() {
    cfg.put( MongoDBProperties.WRITE_CONCERN, WriteConcernType.CUSTOM );
    new MongoDBConfiguration( new ConfigurationPropertyReader( cfg ), getGlobalOptions() );
  }
View Full Code Here

  @Before
  public void setupConfigurationMapAndContexts() {
    cfg = new HashMap<String, Object>();
    cfg.put( OgmProperties.DATABASE, "database" );

    reader = new ConfigurationPropertyReader( cfg, new ClassLoaderServiceImpl() );
    globalOptions = OptionsContextImpl.forGlobal( OptionValueSources.getDefaultSources( reader ) );
  }
View Full Code Here

    );

    AssociationContext associationContext = new AssociationContextImpl(
        new AssociationTypeContextImpl(
            OptionsContextImpl.forProperty(
                OptionValueSources.getDefaultSources( new ConfigurationPropertyReader( sessions.getProperties(), new ClassLoaderServiceImpl() ) ),
                Project.class,
                "modules"
            ),
            new AssociatedEntityKeyMetadata( null, null ),
            null
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

TOP

Related Classes of org.hibernate.ogm.util.configurationreader.spi.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.