posts - 431,  comments - 344,  trackbacks - 0
公告
 Don't Repeat Yourself
座右铭:you can lose your money, you can spent all of it, and if you work hard you get it all back. But if you waste your time, you're never gonna get it back.
公告本博客在此声明部分文章为转摘,只做资料收集使用。


微信: szhourui
QQ:109450684
Email
lsi.zhourui@gmail.com
<2007年7月>
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

留言簿(15)

随笔分类(1019)

文章分类(3)

文章档案(21)

收藏夹

Link

好友博客

最新随笔

搜索

  •  

积分与排名

  • 积分 - 855802
  • 排名 - 47

最新评论

阅读排行榜

分类pointcuts
    遵循特定的语法用于捕获每一个种类的可使用连接点。
    主要的种类:
  • 方法执行:execution(MethodSignature)
  • 方法调用:call(MethodSignature)
  • 构造器执行:execution(ConstructorSignature)
  • 构造器调用:call(ConstructorSignature)
  • 类初始化:staticinitialization(TypeSignature)
  • 属性读操作:get(FieldSignature)
  • 属性写操作:set(FieldSignature)
  • 例外处理执行:handler(TypeSignature)
  • 对象初始化:initialization(ConstructorSignature)
  • 对象预先初始化:preinitialization(ConstructorSignature)
  • Advice执行:adviceexecution()
   基于控制流的pointcuts
   主要包括两种类型的控制流:
   cflow(Pointcut),捕获所有的连接点在指定的方法执行中,包括执行方法本身。
   cflowbelow(Pointcut),捕获所有的连接点在指定的方法执行中,除了执行方法本身。

   如以下的例子:
   cflow(call(* Account.debit(..))
   所有的debit方法中的连接点,包括debit方法本身
   cflowbelow(call(* Account.debit(..))
   所有debit方法中的连接点,除了debit方法本身
   cflow(transactedOperations())
   所有由transactedOperations捕获的连接点
   cflowbelow(execution(Account.new(..))
   所有在Account 构造器中执行的连接点

   基于词汇结构的连接点
   源代码片断。,如within()和withincode()
   within :捕获在指定类或者方面中的程序体中的所有连接点,包括内部类。
   Withincode:用于捕获在构造器或者方法中的所有连接点,包括在其中的本地类

   执行对象连接点
   匹配this,和target对象,作为方法被调用的对象。
   this(Account),所有Account的实例的执行点,匹配所有的连接点,如方法调用,属性设置,当前的执行对象为Account,或者其子类。
   target(Account):匹配所有的连接点,目标对象为Account或其子类。

   必须执行相应的类型,不能使用*,或者..通配符。当前静态方法,不能被匹配。

   在within()和this()中的区别:
   一个是程序体,而另一个为对象执行。

   参数pointcuts
   用于捕获参数类型的连接点。
   args(String,..,int)
   args(RemoteException)

   条件检测pointcuts
   if(System.currentTimeMillis()>triggerTime)
posted on 2007-07-04 16:39 周锐 阅读(262) 评论(0)  编辑  收藏 所属分类: AspectJ

只有注册用户登录后才能发表评论。


网站导航: