/** * Creates an error event and calls {@link ConfigurationErrorListener#configurationError(ConfigurationErrorEvent)} * for all listeners while catching Throwable. */ @Override protected void fireError(int type, String propName, Object propValue, Throwable ex) { if (errorListeners == null || errorListeners.size() == 0) { return; } ConfigurationErrorEvent event = createErrorEvent(type, propName, propValue, ex); for (ConfigurationErrorListener l: errorListeners) { try { l.configurationError(event); } catch (Throwable e) { logger.error("Error firing configuration error event", e); } } }
/** * Creates an error event object and delivers it to all registered error * listeners. * * @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 ex the {@code Throwable} object that caused this error event * @since 1.4 */ protected void fireError(int type, String propName, Object propValue, Throwable ex) { Iterator<ConfigurationErrorListener> it = errorListeners.iterator(); if (it.hasNext()) { ConfigurationErrorEvent event = createErrorEvent(type, propName, propValue, ex); while (it.hasNext()) { it.next().configurationError(event); } } }
/** * Creates an error event and calls {@link ConfigurationErrorListener#configurationError(ConfigurationErrorEvent)} * for all listeners while catching Throwable. */ @Override protected void fireError(int type, String propName, Object propValue, Throwable ex) { if (errorListeners == null || errorListeners.size() == 0) { return; } ConfigurationErrorEvent event = createErrorEvent(type, propName, propValue, ex); for (ConfigurationErrorListener l: errorListeners) { try { l.configurationError(event); } catch (Throwable e) { logger.error("Error firing configuration error event", e); } } }
/** * Creates an error event object and delivers it to all registered error * listeners. * * @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 ex the {@code Throwable} object that caused this error event * @since 1.4 */ protected void fireError(int type, String propName, Object propValue, Throwable ex) { Iterator<ConfigurationErrorListener> it = errorListeners.iterator(); if (it.hasNext()) { ConfigurationErrorEvent event = createErrorEvent(type, propName, propValue, ex); while (it.hasNext()) { it.next().configurationError(event); } } }
@Override public void configurationError(ConfigurationErrorEvent event) { if (event.getSource() instanceof XMLConfiguration) { for (ConfigurationErrorListener listener : getErrorListeners()) { listener.configurationError(event); } } if (event.getType() == AbstractFileConfiguration.EVENT_RELOAD) { if (isThrowable(event.getCause())) { throw new ConfigurationRuntimeException(event.getCause()); } } }
@Override public void configurationError(ConfigurationErrorEvent event) { if (event.getSource() instanceof XMLConfiguration) { for (ConfigurationErrorListener listener : getErrorListeners()) { listener.configurationError(event); } } if (event.getType() == AbstractFileConfiguration.EVENT_RELOAD) { if (isThrowable(event.getCause())) { throw new ConfigurationRuntimeException(event.getCause()); } } }