自动创建代理
- BeanPostProcessor
- BeanNameAutoProxyCreator
- DefaultAdvisorAutoProxyCreator
- AnnotationAwareAspectJAutoProxyCreator
BeanNameAutoProxyCreator
<bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"
p:beanNames="*Target"
p:interceptorNames="greetingAdvice"
p:optimize="true"/>
DefaultAdvisorAutoProxyCreator
<bean id="waiter" class="com.smart.advisor.Waiter"/>
<bean id="seller" class="com.smart.advisor.Seller"/>
<bean id="greetingAdvice" class="com.smart.advisor.GreetingBeforeAdvice"/>
<bean id="regexpAdvisor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor"
p:advice-ref="greetingAdvice">
<property name="patterns">
<list>
<value>.*greet.*</value>
</list>
</property>
</bean>
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"/>