@Override public void configurationChanged(ConfigurationEvent event) { // Note that this method may be called several times if several config options // are changed. The effect is harmless except that we create and discard more // objects than we need to. LOG.debug("Config changed callback invoked with event {} {} {} {}", new Object[] { event.getPropertyName(), event.getPropertyValue(), event.getType(), event.isBeforeUpdate()}); if (!event.isBeforeUpdate()) { limiterStatsLogger.getCounter("config_changed").inc(); LOG.debug("Rebuilding limiter"); limiter = build(); } } };
@Override public void configurationChanged(ConfigurationEvent event) { LOG.info("config changed {}", event); // Throw after so we actually see the update anyway. if (!event.isBeforeUpdate()) { count.getAndIncrement(); throw new RuntimeException("config listener threw and exception"); } } });
@Override public void configurationChanged(ConfigurationEvent event) { if (event.getType() == AbstractFileConfiguration.EVENT_RELOAD) needsReloading = true; } }
private void loadConfigurations(String prefix) { ConcurrentCompositeConfiguration config = (ConcurrentCompositeConfiguration) DynamicPropertyFactory .getBackingConfigurationSource(); loadConfigurations(config, prefix); config.addConfigurationListener(event -> { if (event.getPropertyName().startsWith(prefix)) { LOG.info("Access rule have been changed. Reload configurations. Event=" + event.getType()); loadConfigurations(config, prefix); } }); }
@Override public void configurationChanged(ConfigurationEvent event) { if (event.getSource() instanceof XMLConfiguration) { for (ConfigurationListener listener : getConfigurationListeners()) { listener.configurationChanged(event); } } }
private void removeListeners(EventSource eventSource) { for(ConfigurationListener listener : eventSource.getConfigurationListeners()) { if(listener instanceof ConfigurationListenerImpl) { eventSource.removeConfigurationListener(listener); } } }
@Override public void addConfigurationListener(ConfigurationListener l) { eventSource.addConfigurationListener(l); }
@Override public Collection<ConfigurationListener> getConfigurationListeners() { return eventSource.getConfigurationListeners(); } }
/** * Returns a flag whether detail events are enabled. * * @return a flag if detail events are generated */ public boolean isDetailEvents() { return checkDetailEvents(0); }
/** * Creates a new instance of {@code EventSource}. */ public EventSource() { initListeners(); }
@Override public boolean removeErrorListener(ConfigurationErrorListener l) { return eventSource.removeErrorListener(l); }
@Override public Collection<ConfigurationErrorListener> getErrorListeners() { return eventSource.getErrorListeners(); }
@Override public void clearConfigurationListeners() { eventSource.clearConfigurationListeners(); }
@Override public void clearErrorListeners() { eventSource.clearErrorListeners(); }
@Override public void configurationChanged(ConfigurationEvent event) { StaticAbstractConfiguration.this.fireEvent(event.getType(), event.getPropertyName(), event.getPropertyValue(), event.isBeforeUpdate()); } };
private void loadConfigurations() { ConcurrentCompositeConfiguration config = (ConcurrentCompositeConfiguration) DynamicPropertyFactory .getBackingConfigurationSource(); loadConfigurations(config); config.addConfigurationListener(event -> { if (event.getPropertyName().startsWith(KEY_MAPPING_PREIX)) { LOG.info("Map rule have been changed. Reload configurations. Event=" + event.getType()); loadConfigurations(config); } }); }
@Override public void configurationChanged(ConfigurationEvent event) { if (event.getType() == AbstractFileConfiguration.EVENT_RELOAD) needsReloading = true; } }
/** * Returns a flag whether detail events are enabled. * * @return a flag if detail events are generated */ public boolean isDetailEvents() { return checkDetailEvents(0); }
/** * Creates a new instance of {@code EventSource}. */ public EventSource() { initListeners(); }
public void configurationChanged(ConfigurationEvent event) { if (event.getType() == AbstractFileConfiguration.EVENT_RELOAD) needsReloading = true; } }