Interface EventHandler<L, E extends EventObject>
- Type Parameters:
L- the listener typeE- the event type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A callback invoked by
EventManager when an event is dispatched to a registered listener. The listener
itself is passed as the first argument, so the handler is normally an unbound method reference such as
MyListener::onEvent. An unbound reference captures no state and lets the EventManager hold the
listener via a weak reference, releasing the registration once the listener is garbage collected. A lambda
or bound reference that captures the listener (e.g. this::onEvent) defeats this and keeps the
listener alive for as long as the EventManager is.- Since:
- 5.0
-
Method Summary
-
Method Details
-
handle
-