boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - AOP 中的 self-invocation 问题
相关主题
spring transaction的问题
What do you think about AOP?
看Spring真是头大
How to intercept a method call
spring AOP question
这样理解spring的AOP
如何把函数体放入到 try ... catch ... 中
aspectJ Question
有多少人对annotation这个东西不满,请举手!!
interesting
相关话题的讨论汇总
话题: invocation话题: aop话题: self话题: aspectj话题: proxy
进入Java版参与讨论
1 (共1页)
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.

1 (共1页)
进入Java版参与讨论
相关主题
interesting
AspectJ question
aspectJ question
aspectJ question
another aspectJ question
aspectJ + ant , how to define task?
aspectj question
没有源代码,想替换掉一个class文件里的类
Please give me some ideas!! About the Object database invocation.
invokedynamic
相关话题的讨论汇总
话题: invocation话题: aop话题: self话题: aspectj话题: proxy