AspectJ bean pointcut supports qualifier match

Issue: SPR-11217
This commit is contained in:
Juergen Hoeller
2016-08-17 00:43:41 +02:00
parent e802f0e731
commit 214c919742
4 changed files with 72 additions and 56 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -69,6 +69,7 @@ public class BeanNamePointcutTests {
counterAspect.reset();
}
// We don't need to test all combination of pointcuts due to BeanNamePointcutMatchingTests
@Test

View File

@@ -21,9 +21,11 @@
</aop:aspect>
</aop:config>
<bean id="testBean1" name="myBean" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="tb1" name="testBean1" class="org.springframework.tests.sample.beans.TestBean">
<qualifier value="myBean"/>
</bean>
<bean id="testBean2" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="tb2" name="testBean2" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="testBeanContainingNestedBean" class="org.springframework.tests.sample.beans.TestBean">
<property name="doctor">
@@ -50,7 +52,7 @@
<bean id="counterAspect" class="org.springframework.aop.aspectj.Counter"/>
<aop:config>
<aop:advisor pointcut="bean(*This) and !bean(dont*)" advice-ref="testInterceptor"/>
<aop:advisor pointcut="bean(*This) and !bean(dont*)" advice-ref="testInterceptor"/>
</aop:config>
<bean id="interceptThis" class="org.springframework.tests.sample.beans.TestBean"/>