You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow to specify bean qualifier in an AOP @Around / @Before / ... [SPR-11217] #15842
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).
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.
Activity
spring-projects-issues commentedon Aug 12, 2016
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 ourbeandesignator, 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 commentedon Aug 16, 2016
Francisco Lozano commented
This is great. I will try it tomorrow the first thing in the morning. Thanks.