Java 类org.apache.commons.configuration.event.ConfigurationErrorListener 实例源码

项目:herd    文件:ReloadablePropertySource.java   
/**
 * Constructs the object with all parameters specified.
 *
 * @param name the name of the property source.
 * @param source the properties.
 * @param configuration the configuration that knows how to read properties.
 * @param refreshIntervalSecs the refresh interval in seconds to wait before refreshing the properties when a property is requested.
 */
@SuppressWarnings({"unchecked", "rawtypes"})
public ReloadablePropertySource(String name, Properties source, Configuration configuration, long refreshIntervalSecs)
{
    super(name, (Map) source);
    this.configuration = configuration;

    /*
     * Catches any errors and records it in the lastConfigurationErrorEvent variable.
     * It is safe to assume that all configurations are an instance of EventSource.
     * All concrete implementations of Configuration are an extension of AbstractConfiguration, which is an extension of EventSource.
     */
    ((EventSource) configuration).addErrorListener(new ConfigurationErrorListener()
    {
        @Override
        public void configurationError(ConfigurationErrorEvent event)
        {
            lastConfigurationErrorEvent = event;
        }
    });

    this.refreshIntervalMillis = refreshIntervalSecs * MILLISECONDS_IN_A_SECOND;
    updateLastRefreshTime();
    updateRefreshInterval();
    LOGGER.info("A refresh interval has been configured. propertiesRefreshIntervalInSeconds={}", refreshIntervalSecs);
}
项目: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);
}
项目:otroslogviewer    文件:OtrosConfiguration.java   
@Override
public void addErrorListener(ConfigurationErrorListener l) {
  eventSource.addErrorListener(l);
}
项目:otroslogviewer    文件:OtrosConfiguration.java   
@Override
public boolean removeErrorListener(ConfigurationErrorListener l) {
  return eventSource.removeErrorListener(l);
}
项目:otroslogviewer    文件:OtrosConfiguration.java   
@Override
public Collection<ConfigurationErrorListener> getErrorListeners() {
  return eventSource.getErrorListeners();
}