这两天学习JSF / AspectJ / Refactoring
2005-05-27 12:59
369 查看
这几天在学习JSF / AspectJ / Refactoring, 以及在eclipse下的使用。
AspectJ中的四个概念:
Pointcuts - 切入点(类似于一个动作,一件事情,甚至一组动作或事情等等),具体可以是一个或者几个方法,实例化,赋值(set,get),异常,block ... 具体有一下这些(后面几个我的理解也是模糊的,那位高手可以准确这些概念,谢谢先):
Instanceof checks and context exposurethis(Type or Id)every join point when the currently executing object is an instance of Type or Id's type target(Type or Id)every join point when the target executing object is an instance of Type or Id's type args(Type or Id, ...)every join point when the arguments are instances of Types or the types of the Ids Control Flowcflow(Pointcut)every join point in the control flow of each join point P picked out by Pointcut, including P itself cflowbelow(Pointcut)every join point below the control flow of each join point P picked out by Pointcut; does not include P itself Conditionalif(Expression)every join point when the boolean Expression is trueCombination! Pointcutevery join point not picked out by PointcutPointcut0 && Pointcut1each join point picked out by both Pointcut0 and Pointcut1Pointcut0 || Pointcut1each join point picked out by either Pointcut0 or Pointcut1( Pointcut )each join point picked out by Pointcut
Type Patterns
Advice before( Formals ) runs before each join point after( Formals ) returning [ ( Formal ) ] runs after each join point that returns normally. The optional formal gives access to the returned value after( Formals ) throwing [ ( Formal ) ] runs after each join point that throws a Throwable. If the optional formal is present, runs only after each join point that throws a Throwable of the type of Formal, and Formal gives access to the Throwable exception value after( Formals ) runs after each join point regardless of whether it returns normally or throws a Throwable Type around( Formals ) runs in place of each join point. The join point can be executed by calling proceed, which takes the same number and types of arguments as the around advice. Inter-type member declarationsEach inter-type member is one of
Modifiers ReturnType OnType . Id ( Formals ) [ throws TypeList ] { Body } a method on OnType. abstract Modifiers ReturnType OnType . Id ( Formals ) [ throws TypeList ] ; an abstract method on OnType. Modifiers OnType . new ( Formals ) [ throws TypeList ] { Body } a constructor on OnType. Modifiers Type OnType . Id [ = Expression ] ; a field on OnType.
AspectJ中的四个概念:
Pointcuts - 切入点(类似于一个动作,一件事情,甚至一组动作或事情等等),具体可以是一个或者几个方法,实例化,赋值(set,get),异常,block ... 具体有一下这些(后面几个我的理解也是模糊的,那位高手可以准确这些概念,谢谢先):
Methods and Constructors | |
call(Signature) | every call to any method or constructor matching Signature at the call site |
execution(Signature) | every execution of any method or constructor matching Signature |
Fields | |
get(Signature) | every reference to any field matching Signature |
set(Signature) | every assignment to any field matching Signature. The assigned value can be exposed with an args pointcut |
Exception Handlers | |
handler(TypePattern) | every exception handler for any Throwable type in TypePattern. The exception value can be exposed with an args pointcut |
Advice | |
adviceexecution() | every execution of any piece of advice |
Initialization | |
staticinitialization(TypePattern) | every execution of a static initializer for any type in TypePattern |
initialization(Signature) | every initialization of an object when the first constructor called in the type matches Signature, encompassing the return from the super constructor call to the return of the first-called constructor |
preinitialization(Signature) | every pre-initialization of an object when the first constructor called in the type matches Signature, encompassing the entry of the first-called constructor to the call to the super constructor |
Lexical | |
within(TypePattern) | every join point from code defined in a type in TypePattern |
withincode(Signature) | every join point from code defined in a method or constructor matching Signature |
Type Patterns
TypeNamePattern | all types in TypeNamePattern |
SubtypePattern | all types in SubtypePattern, a pattern with a +. |
ArrayTypePattern | all types in ArrayTypePattern, a pattern with one or more []s. |
!TypePattern | all types not in TypePattern |
TypePattern0 && TypePattern1 | all types in both TypePattern0 and TypePattern1 |
TypePattern0 || TypePattern1 | all types in either TypePattern0 or TypePattern1 |
( TypePattern ) | all types in TypePattern |
Modifiers ReturnType OnType . Id ( Formals ) [ throws TypeList ] { Body } a method on OnType. abstract Modifiers ReturnType OnType . Id ( Formals ) [ throws TypeList ] ; an abstract method on OnType. Modifiers OnType . new ( Formals ) [ throws TypeList ] { Body } a constructor on OnType. Modifiers Type OnType . Id [ = Expression ] ; a field on OnType.
相关文章推荐
- Spring框架学习-深入理解AOP02----AOP简介,AspectJ,AOP基于注解和XML配置(5种通知,切面优先级)
- Java学习笔记--jsf篇
- JSF学习(一)——基本问题
- Spring学习-22:Spring的AOP:基于AspectJ的XML配置方式开发
- 这两天的学习笔记
- spring学习--面向切面编程AOP和AspectJ
- 学习 JSF 2.0 - 新链接、RefCards、样例、JSF Fu...
- jsf学习总结(web.xml,content.xml,faces-config.xml等相关配置)
- JSF学习笔记faces-con 4000 fig.xml参数描述
- JSF 学习笔记
- JSF+Seam框架十三条学习心得分享
- 这两天的学习内容
- 学习笔记之springAOP的aspectJ实现注意点总结
- PIC学习两天总结
- 由于客观原因,暂时学习php两天,然后继续学习.net
- JSF学习五Ajax
- 这两天的学习
- Spring-AOP-学习笔记(2)-AspectJ
- JavaServer Faces(JSF)学习笔记
- JSF+Seam框架十三条学习心得分享