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

Examples of org.hibernate.ogm.util.configurationreader.spi.ConfigurationPropertyReader.property()


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


  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

  @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

   *            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
View Full Code Here

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

  @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

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

    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

  public void shouldRetrievePropertyWithInstanceValue() {
    Map<String, Object> properties = new HashMap<String, Object>();
    properties.put( "service", new MyServiceImpl() );

    ConfigurationPropertyReader reader = new ConfigurationPropertyReader( properties, new ClassLoaderServiceImpl() );
    MyService value = reader.property( "service", MyService.class )
        .instantiate()
        .getValue();

    assertThat( value.getClass() ).isEqualTo( MyServiceImpl.class );
  }
View Full Code Here

  public void shouldRetrievePropertyWithClassValue() {
    Map<String, Object> properties = new HashMap<String, Object>();
    properties.put( "service", MyServiceImpl.class );

    ConfigurationPropertyReader reader = new ConfigurationPropertyReader( properties, new ClassLoaderServiceImpl() );
    MyService value = reader.property( "service", MyService.class )
        .instantiate()
        .getValue();

    assertThat( value.getClass() ).isEqualTo( MyServiceImpl.class );
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.