You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first implementation for indexing event listeners and publishers + the corresponding navigation support (go to references) only takes the type of the event into account that is used in the publish method invocation or the listen method declaration. This does not take into account that a publisher might publish events of a subtype, compared to the event type used in the listener.
The event subtype:
public class SpecializedCustomEvent extends CustomEvent {
}
The publishEvent invocation using the subtype:
public void foo() {
this.publisher.publishEvent(new SpecializedCustomEvent());
}
The listener still using the supetype:
@EventListener
public void handleEvent(CustomEvent event) {
}