本文整理汇总了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));
}
}
}
示例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);
}
}
}
示例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;
}
}