@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(); } } };
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); } }); }
ConfigurationListener listener = new ConfigurationListener() { @Override public void configurationChanged(ConfigurationEvent event) { if ( !event.isBeforeUpdate() ){ System.out.println(event.getPropertyName() + " " + event.getPropertyValue()); } } }; configuration.addConfigurationListener(listener);
if (event.isBeforeUpdate()) if (AbstractFileConfiguration.EVENT_RELOAD == event.getType()) switch (event.getType()) .getPropertyName()); PropertyLayoutData data = fetchLayoutData(event .getPropertyName()); data.setSingleLine(!contained); break; case AbstractConfiguration.EVENT_CLEAR_PROPERTY: layoutData.remove(event.getPropertyName()); break; case AbstractConfiguration.EVENT_CLEAR: break; case AbstractConfiguration.EVENT_SET_PROPERTY: fetchLayoutData(event.getPropertyName()); break;
@Override public void configurationChanged(ConfigurationEvent e) { if (e.getPropertyName() != null && e.getPropertyName().equalsIgnoreCase("gui.markColor")) { final Object propertyValue = e.getPropertyValue(); if (propertyValue instanceof MarkerColors) { markerColors = (MarkerColors) propertyValue; } else if (propertyValue instanceof String) { String value = (String) propertyValue; markerColors = MarkerColors.fromString(value); } } }
public synchronized void configurationChanged(ConfigurationEvent event) { if (!(event.getType() == AbstractConfiguration.EVENT_SET_PROPERTY || event.getType() == AbstractConfiguration.EVENT_ADD_PROPERTY || event.getType() == AbstractConfiguration.EVENT_CLEAR_PROPERTY)) { return; if (FlumeLoggerLoader.FLUME_LOGGER_ENABLED_PROPERTY.equals(event.getPropertyName())) { if ("true".equals(event.getPropertyValue())) { if (loggerLoader == null) { } else if (FlumeLoggerLoader.RELOAD_PROPERTIES.contains(event.getPropertyValue())) {
@Override public void configurationChanged(ConfigurationEvent event) { if (!event.isBeforeUpdate()) { switch (event.getType()) { case AbstractConfiguration.EVENT_ADD_PROPERTY: case AbstractConfiguration.EVENT_SET_PROPERTY: case AbstractConfiguration.EVENT_CLEAR_PROPERTY: notifyConfigUpdated(); break; case AbstractConfiguration.EVENT_CLEAR: notifyConfigUpdated(); break; } } } });
@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; } }
public SwitchAutoJump(OtrosApplication otrosApplication) { super(otrosApplication); configuration = getOtrosApplication().getConfiguration(); final boolean enabled = configuration.getBoolean(ConfKeys.JUMP_TO_CODE_AUTO_JUMP_ENABLED, true); Icon icon = getIcon(enabled); putValue(SMALL_ICON, icon); putValue(SHORT_DESCRIPTION, "Turn on/off automatic jump to code during browsing logs."); configuration.addConfigurationListener(event -> { if (event.getPropertyName() != null && event.getPropertyName().equals(ConfKeys.JUMP_TO_CODE_AUTO_JUMP_ENABLED)) { putValue(SMALL_ICON, getIcon(configuration.getBoolean(ConfKeys.JUMP_TO_CODE_AUTO_JUMP_ENABLED, true))); } }); }
/** * Creates a {@code ConfigurationEvent} object based on the passed in * parameters. This is called by {@code fireEvent()} if it decides * that an event needs to be generated. * * @param type the event's type * @param propName the name of the affected property (can be <b>null</b>) * @param propValue the value of the affected property (can be <b>null</b>) * @param before the before update flag * @return the newly created event object */ protected ConfigurationEvent createEvent(int type, String propName, Object propValue, boolean before) { return new ConfigurationEvent(this, type, propName, propValue, before); }
@Override public void configurationChanged(ConfigurationEvent event) { if (event.getSource() instanceof XMLConfiguration) { for (ConfigurationListener listener : getConfigurationListeners()) { listener.configurationChanged(event); } } }
public void configurationChanged( ConfigurationEvent event ) { if ( event.getPropertyName() != null ) { if ( event.isBeforeUpdate() ) { listener.beforeConfigurationChange( registry, event.getPropertyName(), event.getPropertyValue() ); } else { listener.afterConfigurationChange( registry, event.getPropertyName(), event.getPropertyValue() ); } } }
if (event.isBeforeUpdate()) if (AbstractFileConfiguration.EVENT_RELOAD == event.getType()) switch (event.getType()) .getPropertyName()); PropertyLayoutData data = fetchLayoutData(event .getPropertyName()); data.setSingleLine(!contained); break; case AbstractConfiguration.EVENT_CLEAR_PROPERTY: layoutData.remove(event.getPropertyName()); break; case AbstractConfiguration.EVENT_CLEAR: break; case AbstractConfiguration.EVENT_SET_PROPERTY: fetchLayoutData(event.getPropertyName()); break;
/** * {@inheritDoc} */ @Override public void configurationChanged(ConfigurationEvent evt) { final String propertyName = evt.getPropertyName(); if (propertyName.equals(DroidGlobalProperty.BINARY_UPDATE_URL.getName())) { setEndpointUrl((String) evt.getPropertyValue()); } }
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 && !event.isBeforeUpdate()) { listener.configurationReloaded(); } } }
/** * This method is always called when a subnode configuration created from * this configuration has been modified. This implementation transforms the * received event into an event of type {@code EVENT_SUBNODE_CHANGED} * and notifies the registered listeners. * * @param event the event describing the change * @since 1.5 */ protected void subnodeConfigurationChanged(ConfigurationEvent event) { fireEvent(EVENT_SUBNODE_CHANGED, null, event, event.isBeforeUpdate()); }
@Override public void configurationChanged(ConfigurationEvent event) { if (event.getType() == AbstractFileConfiguration.EVENT_RELOAD) needsReloading = true; } }
/** * Creates a {@code ConfigurationEvent} object based on the passed in * parameters. This is called by {@code fireEvent()} if it decides * that an event needs to be generated. * * @param type the event's type * @param propName the name of the affected property (can be <b>null</b>) * @param propValue the value of the affected property (can be <b>null</b>) * @param before the before update flag * @return the newly created event object */ protected ConfigurationEvent createEvent(int type, String propName, Object propValue, boolean before) { return new ConfigurationEvent(this, type, propName, propValue, before); }