Spring AOP忽略了Hessian Service的某些方法 [英] Spring AOP ignores some methods of Hessian Service
问题描述
我有一个具有以下切入点定义的方面
I have an Aspect with the following pointcut definition
@Pointcut("execution(public de.company.project..* *(..))")
以及包含以下内容的弹簧配置
and a spring configuration containing the following
<aop:aspectj-autoproxy />
<bean id="myaspect"
class="de.company.project.impl.MyAspect" />
<bean id="someService" class="de.company.project.impl.SomeService" />
<bean name="/SomeService"
class="org.springframework.remoting.caucho.HessianServiceExporter">
<property name="service" ref="someService" />
<property name="serviceInterface"
value="de.company.project.interf.SomeService" />
</bean>
(实际配置中有多个服务)
(there are multiple services in the real configuration)
我看到该方面在某些方法中被调用,但不是全部.我怀疑(但尚未完全确定)仅将直接在接口中声明的方法包装在方面中,而忽略在超级接口中声明的方法(尽管该接口应匹配相同的切入点).
I see the aspect getting invoked in some methods, but not on all. I am suspecting (but not completely shure yet) only the methods declared directly in the interface get wrapped in the aspect and methods declared in a superinterface get ignored (although that interface should match the same pointcut).
这是预期的行为吗?我该如何更改?可能还会发生什么?
Is this expected behaviour? How can I change it? What else might be going on?
推荐答案
答案是:我弄乱了Pointcut模式.看起来像这样
The answer is: I messed up the Pointcut pattern. Looks like this
@Pointcut("execution(public de.company.project..* *(..))")
指定返回类型的包,而
@Pointcut("execution(public de.company.project..*(..))")
指定具有该方法的类型的包.
specifies the package of the type which has the method.
这篇关于Spring AOP忽略了Hessian Service的某些方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!