Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Dec 12, 2013 · 2 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Dec 12, 2013

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

@spring-projects-issues
Copy link
Collaborator Author

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.

@spring-projects-issues
Copy link
Collaborator Author

Francisco Lozano commented

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants