當前位置: 首頁>>代碼示例>>Java>>正文


Java AbstractConfiguration.EVENT_SET_PROPERTY屬性代碼示例

本文整理匯總了Java中org.apache.commons.configuration.AbstractConfiguration.EVENT_SET_PROPERTY屬性的典型用法代碼示例。如果您正苦於以下問題:Java AbstractConfiguration.EVENT_SET_PROPERTY屬性的具體用法?Java AbstractConfiguration.EVENT_SET_PROPERTY怎麽用?Java AbstractConfiguration.EVENT_SET_PROPERTY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.apache.commons.configuration.AbstractConfiguration的用法示例。


在下文中一共展示了AbstractConfiguration.EVENT_SET_PROPERTY屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onApplicationEvent

@Override
public void onApplicationEvent(EnvironmentChangeEvent event) {
	AbstractConfiguration manager = ConfigurationManager.getConfigInstance();
	for (String key : event.getKeys()) {
		for (ConfigurationListener listener : manager
				.getConfigurationListeners()) {
			Object source = event.getSource();
			// TODO: Handle add vs set vs delete?
			int type = AbstractConfiguration.EVENT_SET_PROPERTY;
			String value = this.env.getProperty(key);
			boolean beforeUpdate = false;
			listener.configurationChanged(new ConfigurationEvent(source, type,
					key, value, beforeUpdate));
		}
	}
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-netflix,代碼行數:16,代碼來源:ArchaiusAutoConfiguration.java

示例2: invokeListeners

private void invokeListeners()
{
    if (m_configurationListeners != null)
    {
        try
        {
            ConfigurationEvent event = new ConfigurationEvent(this,AbstractConfiguration.EVENT_SET_PROPERTY,null,this, false);
            for (ConfigurationListener listener:m_configurationListeners)
            {
                listener.configurationChanged(event);
            }
        }
        catch (Exception e)
        {
            throw new RuntimeException(e);
        }
    }
}
 
開發者ID:RogerParkinson,項目名稱:MaduraConfiguration,代碼行數:18,代碼來源:MaduraConfiguration.java

示例3: configurationChanged

@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;
	}
}
 
開發者ID:Nastel,項目名稱:TNT4J,代碼行數:30,代碼來源:FileTokenRepository.java


注:本文中的org.apache.commons.configuration.AbstractConfiguration.EVENT_SET_PROPERTY屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。