• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

无信不立

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

spring源码学习之:springAOP实现底层原理

一:springAOP底层实现是基于动态代理实现的。增强和切面,以及通知。是在动态代理生成的代理类inoke方法中调用实现

 1 //+++++++++++++aop动态代理+++++++++++++++++++++++
 2         
 3         
 4         /**
 5          * 通知,表示增强。在某些方法调用前,调用后,抛出异常后,对方法的增强。(是一个具体实现类,类中的方法实现了增强)
 6          */
 7         //方法执行前通知
 8         BeforeAdvice beforeAdvice ;
 9         MethodBeforeAdvice MethdBeforeAdvice;
10         //方法执行后通知
11         AfterAdvice afterAdvice;
12         AfterReturningAdvice afterReturningAdvice;
13         //抛出异常的通知
14         ThrowsAdvice throwsAdvice;
15         ThrowsAdviceInterceptor throwsAdviceInterceptor;
16         
17         
18         /**
19          * 切点(表示那些方法被标记,被动态代理,是一个集合)
20          */
21         Pointcut pointcut;
22         org.springframework.aop.Pointcut pointcut2;
23         JdkRegexpMethodPointcut jdkRegexpMethodPointcut;
24         
25         //jdk动态代理的实现类
26         //JdkDynamicAopProxy JdkDynamicAopProxy;
27         
28         /**
29          * 通知器(将切点和通知器结合起来的实现)
30          */
31         Advisor advisor;
32         DefaultPointcutAdvisor defaultPointcutAdvisor;
33         
34         /**
35          * aop实现的例子
36          */
37         ProxyFactoryBean proxyFactoryBean;
38         org.springframework.http.client.support.ProxyFactoryBean proxyFactoryBean2;
View Code

 

posted on 2017-03-08 13:56  无信不立  阅读(1457)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3