class DataSourceFactory {

    static long retrieveConfigSetting(String propName, long defaultValue) {

        String propValue = System.getProperty(propName);
        if (propValue == null) {
            return defaultValue;
        }
        
        long value = defaultValue;
        try {
            value = Long.parseLong(propValue);
        } catch (NumberFormatException ex) {
            if (LOG.isWarnEnabled()) {
                LOG.warn("Ignoring Invalid number({}) set in system property({}). Using default ({})",
                        propValue, propName, defaultValue);
            }
        }
        
        return value;
    }

}