@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) { // 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(); } } };
/** * 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()); }
/** * 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.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 synchronized void configurationChanged(ConfigurationEvent event) { if (!event.isBeforeUpdate()) { stopAndClearReporter(); start(); } } }
@Override public void configurationChanged(ConfigurationEvent event) { if(event.getType() == AbstractFileConfiguration.EVENT_RELOAD && !event.isBeforeUpdate()) { listener.configurationReloaded(); } } }
@Override public synchronized void configurationChanged(ConfigurationEvent event) { if (!event.isBeforeUpdate()) { stopAndClearReporter(); start(); } } }
ConfigurationListener listener = new ConfigurationListener() { @Override public void configurationChanged(ConfigurationEvent event) { if ( !event.isBeforeUpdate() ){ System.out.println(event.getPropertyName() + " " + event.getPropertyValue()); } } }; configuration.addConfigurationListener(listener);
@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) { StaticAbstractConfiguration.this.fireEvent(event.getType(), event.getPropertyName(), event.getPropertyValue(), event.isBeforeUpdate()); } };
@Override public synchronized void configurationChanged(ConfigurationEvent event) { if ((event.getType() == AbstractConfiguration.EVENT_ADD_PROPERTY || event.getType() == AbstractConfiguration.EVENT_SET_PROPERTY) && StringUtils.equalsIgnoreCase(LOGBACK_CONFIG_NAME, event.getPropertyName()) && event.getPropertyValue() != null && !event.isBeforeUpdate()) { System.out.println("Reloading logging config."); reloadLogging((String)event.getPropertyValue()); } } });
/** * Event listener call back for configuration update events. This method is * called whenever one of the contained configurations was modified. It * invalidates this combined configuration. * * @param event the update event */ public void configurationChanged(ConfigurationEvent event) { if (event.getType() == AbstractFileConfiguration.EVENT_CONFIG_CHANGED) { fireEvent(event.getType(), event.getPropertyName(), event.getPropertyValue(), event.isBeforeUpdate()); } else if (!event.isBeforeUpdate()) { invalidate(); } }
/** * Event listener call back for configuration update events. This method is * called whenever one of the contained configurations was modified. It * invalidates this combined configuration. * * @param event the update event */ public void configurationChanged(ConfigurationEvent event) { if (event.getType() == AbstractFileConfiguration.EVENT_CONFIG_CHANGED) { fireEvent(event.getType(), event.getPropertyName(), event.getPropertyValue(), event.isBeforeUpdate()); } else if (!event.isBeforeUpdate()) { invalidate(); } }
public void configurationChanged(ConfigurationEvent event) { if (!event.isBeforeUpdate()) { // only display events after the modification was done System.out.println(name + " Received event!"); System.out.println(name + " Type = " + event.getType()); if (event.getPropertyName() != null) { System.out.println(name + " Property name = " + event.getPropertyName()); } if (event.getPropertyValue() != null) { System.out.println(name + " Property value = " + event.getPropertyValue()); } } } }
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() ); } } }
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() ); } } } }
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() ); } } } }
/** * Reacts on configuration change events triggered by the delegate. These * events are passed to the registered configuration listeners. * * @param event the triggered event * @since 1.3 */ public void configurationChanged(ConfigurationEvent event) { // deliver reload events to registered listeners setDetailEvents(true); try { fireEvent(event.getType(), event.getPropertyName(), event .getPropertyValue(), event.isBeforeUpdate()); } finally { setDetailEvents(false); } }
/** * Reacts on configuration change events triggered by the delegate. These * events are passed to the registered configuration listeners. * * @param event the triggered event * @since 1.3 */ public void configurationChanged(ConfigurationEvent event) { // deliver reload events to registered listeners setDetailEvents(true); try { fireEvent(event.getType(), event.getPropertyName(), event .getPropertyValue(), event.isBeforeUpdate()); } finally { setDetailEvents(false); } }