本文整理匯總了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;
}
}