Event Handler Entry
Base type for all registered event handler entries.
An EventHandlerEntry represents a single method annotated with @EventHandler that has been discovered and compiled into an EventInvoker. Concrete implementations distinguish between:
instance-bound handlers, tied to a specific subscriber object, and
static handlers, declared as
static/@JvmStaticon a class.
The event system uses this abstraction to store, sort, and dispatch event handlers without exposing implementation details to consumers.
Cancellation Interaction
The runIfCanceled flag reflects the value of runIfCanceled declared on the original @EventHandler annotation. It defines whether this handler should receive events that have been marked as canceled, depending on the CancelMode specified during dispatch:
When
true, the handler may still receive canceled events in CancelMode.RESPECT and CancelMode.IGNORE, but not in CancelMode.ENFORCE, where dispatch halts immediately on cancellation.When
false, the handler receives canceled events only when cancellation is ignored at the dispatch level (i.e., CancelMode.IGNORE).
This behavior allows fine-grained, per-handler control over whether cancellation should prevent the handler from running.