Skip to content

Allow registration of application event listeners in a functional way [SPR-16872] #21411

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions