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

项目:TNT4J    文件:FileTokenRepository.java   
@Override
public void configurationChanged(ConfigurationEvent event) {
    if (event.isBeforeUpdate()) {
        return;
    }
    logger.log(OpLevel.DEBUG, "configurationChanged: type={0}, {1}:{2}", event.getType(), event.getPropertyName(),
            event.getPropertyValue());
    switch (event.getType()) {
    case AbstractConfiguration.EVENT_ADD_PROPERTY:
        repListener.repositoryChanged(new TokenRepositoryEvent(event.getSource(), TokenRepository.EVENT_ADD_KEY,
                event.getPropertyName(), event.getPropertyValue(), null));
        break;
    case AbstractConfiguration.EVENT_SET_PROPERTY:
        repListener.repositoryChanged(new TokenRepositoryEvent(event.getSource(), TokenRepository.EVENT_SET_KEY,
                event.getPropertyName(), event.getPropertyValue(), null));
        break;
    case AbstractConfiguration.EVENT_CLEAR_PROPERTY:
        repListener.repositoryChanged(new TokenRepositoryEvent(event.getSource(), TokenRepository.EVENT_CLEAR_KEY,
                event.getPropertyName(), event.getPropertyValue(), null));
        break;
    case AbstractConfiguration.EVENT_CLEAR:
        repListener.repositoryChanged(new TokenRepositoryEvent(event.getSource(), TokenRepository.EVENT_CLEAR,
                event.getPropertyName(), event.getPropertyValue(), null));
        break;
    case AbstractFileConfiguration.EVENT_RELOAD:
        repListener.repositoryChanged(new TokenRepositoryEvent(event.getSource(), TokenRepository.EVENT_RELOAD,
                event.getPropertyName(), event.getPropertyValue(), null));
        break;
    }
}
项目:artifactory_ssh_proxy    文件:TestOptions.java   
@Test(dataProvider = "overrides")
public void testFindConfigFile(String override, String expected) throws Exception {
    SshdSettingsBuilder testBuilder = new SshdSettingsBuilder();
    Configuration config = testBuilder.findPropertiesConfiguration(override);

    AbstractFileConfiguration fileConfiguration = (AbstractFileConfiguration) config;

    // we need to create expected from a new file.
    // because it's a complete filename.
    File expectedFile = new File(expected);
    String expectedPath = "file://" + expectedFile.getAbsolutePath();
    Assert.assertEquals(fileConfiguration.getFileName(), expectedPath);
}
项目:MaduraConfiguration    文件:ReloadListener.java   
public void configurationChanged(ConfigurationEvent event)
{
    if (!event.isBeforeUpdate() && event.getType() == AbstractFileConfiguration.EVENT_RELOAD)
    {
        if (m_applicationContext instanceof AbstractRefreshableApplicationContext)
        {
            ((AbstractRefreshableApplicationContext)m_applicationContext).refresh();
        }
    }
}