Skip to content

Allow to specify bean qualifier in an AOP @Around / @Before / ... [SPR-11217] #15842

Closed

Description

@spring-projects-issues

Francisco Lozano opened SPR-11217 and commented

Right now it's possible to specify bean(beanName), but it'd be great if you could say qualifier(whatever) so that you can wire aspects not only by bean name or by usual AspectJ pointcuts, but also by bean qualifier, so that any bean configured with

@Bean
@Qualifier("audited")
public MyBean myBean() {}

The same cannot be achieved simply with annotations, as annotation is at class-level and not at bean-level (and I can re-use same class in several beans).


Affects: 3.2.5

Issue Links:

Referenced from: commits 214c919

1 votes, 3 watchers

Activity

  1. spring-projects-issues commented on Aug 12, 2016

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    I've implemented this as bean(qualifier), i.e. within the same pointcut designator, simply not just matching against bean names and aliases but also against String qualifier values now. While this extends the semantics of our bean designator, I do not expect issues with existing setups since specific bean conditions are unlikely to accidentally match qualifier values in corresponding bean definitions.

  2. spring-projects-issues commented on Aug 16, 2016

    @spring-projects-issues
    CollaboratorAuthor

    Francisco Lozano commented

    This is great. I will try it tomorrow the first thing in the morning. Thanks.

  3. added
    type: enhancement
    in: core
    on Jan 11, 2019
  4. added this to the 5.0 M2 milestone 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