Example usage for org.apache.commons.configuration.reloading InvariantReloadingStrategy InvariantReloadingStrategy

List of usage examples for org.apache.commons.configuration.reloading InvariantReloadingStrategy InvariantReloadingStrategy

Introduction

In this page you can find the example usage for org.apache.commons.configuration.reloading InvariantReloadingStrategy InvariantReloadingStrategy.

Prototype

InvariantReloadingStrategy

Source Link

Usage

From source file:org.sakaiproject.dash.dao.impl.DashboardDaoImpl.java

/**
 * Loads our SQL statements from the appropriate properties file
 * @param vendor   DB vendor string. Must be one of mysql, oracle, hsqldb
 *///from  w w w  .ja  v  a 2  s  .  c o  m
protected void initStatements(String vendor) {

    URL url = getClass().getClassLoader().getResource(vendor + ".properties");

    try {
        statements = new PropertiesConfiguration(); //must use blank constructor so it doesn't parse just yet (as it will split)
        statements.setReloadingStrategy(new InvariantReloadingStrategy()); //don't watch for reloads
        statements.setThrowExceptionOnMissing(true); //throw exception if no prop
        statements.setDelimiterParsingDisabled(true); //don't split properties
        statements.load(url); //now load our file
    } catch (ConfigurationException e) {
        log.warn(e.getClass() + ": " + e.getMessage());
        return;
    }
}

From source file:org.sakaiproject.delegatedaccess.dao.impl.DelegatedAccessDaoImpl.java

/**
 * Loads our SQL statements from the appropriate properties file
         //from  ww  w .j a v a  2 s  .c o m
 * @param vendor   DB vendor string. Must be one of mysql, oracle, hsqldb
 */
private void initStatements(String vendor) {

    URL url = getClass().getClassLoader().getResource(vendor + ".properties");

    try {
        statements = new PropertiesConfiguration(); //must use blank constructor so it doesn't parse just yet (as it will split)
        statements.setReloadingStrategy(new InvariantReloadingStrategy()); //don't watch for reloads
        statements.setThrowExceptionOnMissing(true); //throw exception if no prop
        statements.setDelimiterParsingDisabled(true); //don't split properties
        statements.load(url); //now load our file
    } catch (ConfigurationException e) {
        log.error(e.getClass() + ": " + e.getMessage(), e);
        return;
    }
}