public interface EventSource
An interface for configuration implementations which support registration of event listeners.
Through the methods provided by this interface it is possible to register and remove listeners for different events supported by this library. The event type to be handled by a listener must be provided; the specified event listener must be compatible with this event type. By using generic type parameters, the compiler can check this.
Modifier and Type | Method and Description |
---|---|
<T extends Event> |
addEventListener(EventType<T> eventType,
EventListener<? super T> listener)
Adds an event listener for the specified event type.
|
<T extends Event> |
removeEventListener(EventType<T> eventType,
EventListener<? super T> listener)
Removes the event listener registration for the given event type and
listener.
|
<T extends Event> void addEventListener(EventType<T> eventType, EventListener<? super T> listener)
T
- the type of events processed by this listenereventType
- the event type (must not be null)listener
- the listener to be registered (must not be null)IllegalArgumentException
- if a required parameter is null<T extends Event> boolean removeEventListener(EventType<T> eventType, EventListener<? super T> listener)
T
- the type of events processed by this listenereventType
- the event typelistener
- the event listener to be removedCopyright © 2001–2020 The Apache Software Foundation. All rights reserved.