A base class for objects that can generate configuration events.
This class implements functionality for managing a set of event listeners that can be notified when an event occurs. It can be extended by configuration classes that support the event mechanism. In this case these classes only need to call the {@code fireEvent()} method when an event is tobe delivered to the registered listeners.
Adding and removing event listeners can happen concurrently to manipulations on a configuration that cause events. The operations are synchronized.
With the {@code detailEvents} property the number of detail events can becontrolled. Some methods in configuration classes are implemented in a way that they call other methods that can generate their own events. One example is the {@code setProperty()} method that can be implemented as a combinationof {@code clearProperty()} and {@code addProperty()}. With {@code detailEvents} set to true, all involved methods will generateevents (i.e. listeners will receive property set events, property clear events, and property add events). If this mode is turned off (which is the default), detail events are suppressed, so only property set events will be received. Note that the number of received detail events may differ for different configuration implementations. {@link org.apache.commons.configuration2.BaseHierarchicalConfiguration BaseHierarchicalConfiguration} for instance has a custom implementation of{@code setProperty()}, which does not generate any detail events.
In addition to "normal" events, error events are supported. Such events signal an internal problem that occurred during access of properties. They are handled via the regular {@link EventListener} interface, but thereare special event types defined by {@link ConfigurationErrorEvent}. The {@code fireError()} method can be used by derived classes to sendnotifications about errors to registered observers.
@version $Id: BaseEventSource.java 1624601 2014-09-12 18:04:36Z oheger $
@since 1.3