1. 判断需要AOP增强;
    2. 查找对应的增强类或者增强器;
    3. 创建代理对象植入增强;
    4. 代理对象执行方法的增强。

    后面的代码大部分基于常用的 SpringAOP + Aspectj 注解的形式展开。

    1. <beans xmlns="http://www.springframework.org/schema/beans"
    2. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    3. xmlns:aop="http://www.springframework.org/schema/aop"
    4. xsi:schemaLocation="http://www.springframework.org/schema/beans
    5. https://www.springframework.org/schema/beans/spring-beans.xsd
    6. http://www.springframework.org/schema/aop
    7. https://www.springframework.org/schema/aop/spring-aop.xsd">
    8. <!-- 基于aspectj 注解 -->
    9. <aop:aspectj-autoproxy proxy-target-class="true"/>
    10. <!-- 接口 -->
    11. <bean id="userService" class="cn.lichenghao.aop.jdk.service.impl.UserServiceImpl"></bean>
    12. <!-- 通知类 -->
    13. <bean id="aopLogger" class="cn.lichenghao.aop.AopLogger2"></bean>
    14. </beans>