Example usage for org.apache.commons.configuration AbstractFileConfiguration EVENT_RELOAD

List of usage examples for org.apache.commons.configuration AbstractFileConfiguration EVENT_RELOAD

Introduction

In this page you can find the example usage for org.apache.commons.configuration AbstractFileConfiguration EVENT_RELOAD.

Prototype

int EVENT_RELOAD

To view the source code for org.apache.commons.configuration AbstractFileConfiguration EVENT_RELOAD.

Click Source Link

Document

Constant for the configuration reload event.

Usage

From source file:com.jkoolcloud.tnt4j.repository.FileTokenRepository.java

@Override
public void configurationChanged(ConfigurationEvent event) {
    if (event.isBeforeUpdate())
        return;/*from w w w  . j  a  v  a 2  s  .  c o  m*/
    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;
    }
}

From source file:nz.co.senanque.madura.configuration.ReloadListener.java

public void configurationChanged(ConfigurationEvent event) {
    if (!event.isBeforeUpdate() && event.getType() == AbstractFileConfiguration.EVENT_RELOAD) {
        if (m_applicationContext instanceof AbstractRefreshableApplicationContext) {
            ((AbstractRefreshableApplicationContext) m_applicationContext).refresh();
        }/*ww w .  j a va  2 s .  c o m*/
    }
}