EventListener (Apache Commons Configuration 2.15.1 API)
Description: declaration: package: org.apache.commons.configuration2.event, interface: EventListener

Package org.apache.commons.configuration2.event

# 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

  Modifier and Type
  Method
  Description
  `void`
  `onEvent(T event)`
  Notifies this event listener about the arrival of a new event.

- ## Method Details

  - ### onEvent

    void onEvent(T event)
    Notifies this event listener about the arrival of a new event. Typically, event listeners are registered at an event source providing an `EventType`. This event type acts as a filter; all events matched by the filter are passed to the listener. The type parameters defined by the `EventType` class and this interface guarantee that the events delivered to the handler are compatible with the concrete method signature of `onEvent()`.
    Parameters:
      `event` - the event