b**L 发帖数: 646 | 1 谁能给个sample code 说说怎么用AspectJ 解决 AOP 的self-invocation?
"AspectJ does not have this self-invocation issue because it is not a proxy-
based" quote from:
http://static.springsource.org/spring/docs/3.0.x/reference/aop. | t*******e 发帖数: 684 | 2 Spring自带的是proxy based AOP,比较弱,self-invocation skips the proxy class
。Aspectj支持compile time weaving CTW, post compile time weaving, load time
weaving LTW,就没有这个局限,不过用起来要多几个步骤。CTW用ANT,Maven,plugin不
同。LTW加java agent. | b**L 发帖数: 646 | 3 谢谢totempole。
找到一个workaround 的方法了。
就是在class 里设一个指向自己的instance field. 在this.func() 的地方改成
instance.func().
class
time
【在 t*******e 的大作中提到】 : Spring自带的是proxy based AOP,比较弱,self-invocation skips the proxy class : 。Aspectj支持compile time weaving CTW, post compile time weaving, load time : weaving LTW,就没有这个局限,不过用起来要多几个步骤。CTW用ANT,Maven,plugin不 : 同。LTW加java agent.
|
|