由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - AOP 中的 self-invocation 问题
相关主题
spring transaction的问题有多少人对annotation这个东西不满,请举手!!
What do you think about AOP?interesting
看Spring真是头大AspectJ question
How to intercept a method callaspectJ question
spring AOP questionaspectJ question
这样理解spring的AOPanother aspectJ question
如何把函数体放入到 try ... catch ... 中aspectJ + ant , how to define task?
aspectJ Questionaspectj question
相关话题的讨论汇总
话题: 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版参与讨论
相关主题
aspectj questionspring AOP question
没有源代码,想替换掉一个class文件里的类这样理解spring的AOP
Please give me some ideas!! About the Object database invocation.如何把函数体放入到 try ... catch ... 中
invokedynamicaspectJ Question
spring transaction的问题有多少人对annotation这个东西不满,请举手!!
What do you think about AOP?interesting
看Spring真是头大AspectJ question
How to intercept a method callaspectJ question
相关话题的讨论汇总
话题: invocation话题: aop话题: self话题: aspectj话题: proxy