Skip to content

Genericize ApplicationListener [SPR-4610] #9287

Closed
@spring-projects-issues

Description

@spring-projects-issues

Paul Benedict opened SPR-4610 and commented

It would be fantastic if ApplicationListener could be genericized so that the event argument automatically becomes the parameterized type. Maybe worth looking at in 3.0? In any event (pun intended), the framework could then skip over invoking the handler if the typed argument is not the correct type. This would eliminate the boilerplate of "if (event instanceof MySubclassEvent)" checks.

Can anything be done like this in 2.5?


Affects: 2.5.2

1 votes, 1 watchers

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