Closed
Description
Oliver Drotbohm opened SPR-16872 and commented
ConfigurableApplicationContext
currently exposes addApplicationListener(…)
which unfortunately isn't usable with lambdas as they don't retain generics information that's used downstream to properly route events to.
It would be cool if there was an overload addApplicationListener(Class<T> type, Consumer<T> consumer)
that internally creates a GenericApplicationListenerAdapter
to carry the type information forward.
Issue Links:
- Introduce API to select application listeners [SPR-15441] #20002 Introduce API to select application listeners
- Resolved ApplicationListener event type should get cached [SPR-16970] #21508 Resolved ApplicationListener event type should get cached