Java 类org.apache.commons.configuration.DatabaseConfiguration 实例源码

项目:spring-configuration-support    文件:DatabaseConfigurationPropertiesFactoryBean.java   
protected void init() {

        LinkedHashMap<String,Properties> propertiesByEnvironment = new LinkedHashMap<>();

        // fetch properties for each specific environment
        environments.forEach(currentEnvironment -> {
            DatabaseConfiguration dbConfig = createDatabaseConfiguration(this.dataSource,this.tableName,this.environmentColumn,this.propertyKeyColumn,this.valueColumn,currentEnvironment);
            propertiesByEnvironment.put(PROPERTY_SOURCE_PREFIX + "-" + currentEnvironment, createPropertiesForConfiguration(dbConfig));
        });

        // fetch default properties
        DatabaseConfiguration dbConfigDefault = createDatabaseConfiguration(this.dataSource,this.tableName,this.environmentColumn,this.propertyKeyColumn,this.valueColumn,this.defaultEnvironment);
        propertiesByEnvironment.put(PROPERTY_SOURCE_PREFIX + "-" + PROPERTY_SOURCE_DEFAULT, createPropertiesForConfiguration(dbConfigDefault));

        this.properties = new OrderedProperties(propertiesByEnvironment);
    }
项目:common-security-module    文件:ConfigurationHelper.java   
private ConfigurationHelper(String applicationContextName)
{   

 DataSource ds = getDataSourceForContext(applicationContextName);                   
 DatabaseConfiguration config = new DatabaseConfiguration(ds,
                 TABLE_NAME, KEY_COLUMN, VALUE_COLUMN);

 ConfigurationListener listener = new LockoutConfigurationListener();
 config.addConfigurationListener(listener);
 config.addErrorListener((ConfigurationErrorListener) listener);            
 config.setDelimiterParsingDisabled(true);
 dataConfig = new DataConfiguration(config);
}
项目:caarray    文件:ConfigurationHelper.java   
/**
 * @return the system configuration.
 */
public static DataConfiguration getConfiguration() {
    DataSource ds = null;
    try {
        ds = (DataSource) ServiceLocatorFactory.getLocator().lookup(DATASOURCE_JNDI_LOC);
        if (ds == null) {
            ds = getAdhocDataSource();
        }
    } catch (IllegalStateException e) {
        ds = getAdhocDataSource();
    }
    DatabaseConfiguration config = new DatabaseConfiguration(ds, TABLE_NAME, PARAM_NAME_COLUMN, PARAM_VALUE_COLUMN);
    config.setDelimiterParsingDisabled(true);
    return new DataConfiguration(config);
}
项目:java-platform    文件:MallConfiguration.java   
@Bean
public DatabaseConfiguration mallConfig() {
    return new DefaultDatabaseConfiguration(dataSource, "mall", "商城配置");
}
项目:java-platform    文件:ExtraConfigConfiguration.java   
@Bean
public DatabaseConfiguration mainConfig() {
    return new DefaultDatabaseConfiguration(dataSource, "main", "基础配置");
}
项目:caintegrator    文件:ConfigurationHelperImpl.java   
private DataConfiguration getConfiguration() {
    DatabaseConfiguration config =
        new DatabaseConfiguration(dataSource, TABLE_NAME, PARAM_NAME_COLUMN, PARAM_VALUE_COLUMN);
    config.setDelimiterParsingDisabled(true);
    return new DataConfiguration(config);
}
项目:spring-configuration-support    文件:DatabaseConfigurationPropertiesFactoryBean.java   
/**
 * Creates a DatabaseConfiguration instance with the specified parameters.
 *
 * @param dataSource the data-source
 * @param tableName the table name
 * @param environmentColumn the environment column
 * @param keyColumn the key column
 * @param valueColumn the value column
 * @param environment the environment
 * @return the DatabaseConfiguration instance
 */
protected DatabaseConfiguration createDatabaseConfiguration(DataSource dataSource, String tableName, String environmentColumn, String keyColumn, String valueColumn, String environment){
    DatabaseConfiguration databaseConfiguration = new DatabaseConfiguration(dataSource,tableName,environmentColumn,keyColumn,valueColumn,environment);
    databaseConfiguration.setDelimiterParsingDisabled(true);
    return databaseConfiguration;
}
项目:herd    文件:DaoSpringModuleConfig.java   
/**
 * Gets a database configuration that can be used to read database properties.
 *
 * @return the property database configuration.
 */
private static DatabaseConfiguration getPropertyDatabaseConfiguration()
{
    return new DatabaseConfiguration(getHerdDataSource(), ConfigurationEntity.TABLE_NAME, ConfigurationEntity.COLUMN_KEY, ConfigurationEntity.COLUMN_VALUE);
}