Interface EventListener<T extends Event>
- Type Parameters:
T
- the type of events this listener can process
- All Known Implementing Classes:
CombinedConfiguration
,DynamicCombinedConfiguration
,PropertiesConfigurationLayout
public interface EventListener<T extends Event>
Definition of a generic event listener interface.
This event listener interface is used throughout the Commons Configuration library for reacting on all kinds
of supported events. The interface is pretty minimalistic, defining only a single onEvent()
method. This
simplifies the implementation of custom event listeners and also supports the new language features introduced with
Java 8 (EventListener
is a functional interface and thus can be represented by a Lambda expression).
- Since:
- 2.0
-
Method Summary
-
Method Details
-
onEvent
Notifies this event listener about the arrival of a new event. Typically, event listeners are registered at an event source providing anEventType
. This event type acts as a filter; all events matched by the filter are passed to the listener. The type parameters defined by theEventType
class and this interface guarantee that the events delivered to the handler are compatible with the concrete method signature ofonEvent()
.- Parameters:
event
- the event
-