Skip to content

Support @Order on ApplicationListeners [SPR-12410] #17018

Closed

Description

@spring-projects-issues

Sam Brannen opened SPR-12410 and commented

Status Quo

AbstractApplicationEventMulticaster currently sorts ApplicationListener instances based on the Ordered interface, but the sorting algorithm does not honor annotations.

At the time of this writing, there are two invocations of OrderComparator.sort() within AbstractApplicationEventMulticaster.

Proposal

Refactor AbstractApplicationEventMulticaster to use AnnotationAwareOrderComparator.sort() instead of OrderComparator.sort().


Affects: 3.0 GA

Issue Links:

Referenced from: commits 8eb7bee

Activity

  1. spring-projects-issues commented on Feb 16, 2015

    @spring-projects-issues
    CollaboratorAuthor

    Stéphane Nicoll commented

    ApplicationListener implementations can now be ordered either using @Order or by implementing the Ordered interface.

  2. added
    type: enhancement
    in: core
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: coretype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions