Example usage for org.apache.commons.configuration.event ConfigurationErrorListener configurationError

List of usage examples for org.apache.commons.configuration.event ConfigurationErrorListener configurationError

Introduction

In this page you can find the example usage for org.apache.commons.configuration.event ConfigurationErrorListener configurationError.

Prototype

void configurationError(ConfigurationErrorEvent event);

Source Link

Document

Notifies this listener that in an observed configuration an error occurred.

Usage

From source file:com.netflix.config.ConcurrentMapConfiguration.java

/**
 * Creates an error event and calls {@link ConfigurationErrorListener#configurationError(ConfigurationErrorEvent)}
 * for all listeners while catching Throwable.
 *///w  ww  . j a v a 2  s  .co m
@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);
        }
    }
}