spring aop-环绕通知不起作用
环境:spring 3.0.5java拦截器代码
package com.atman.hci.agent.interceptor;
import org.aspectj.lang.ProceedingJoinPoint;
public class MessageInterceptor {
public void invoke(ProceedingJoinPoint joinPoint) throws Throwable {
System.out.println("Logging before " + joinPoint.getSignature().getName());
Object retVal = joinPoint.proceed();
System.out.println("Logging after " + joinPoint.getSignature().getName());
}
}
被拦截的类就是1个普通的类,实现了自己的接口,但是没有实现spring的相关接口
spring配置
<aop:config
<aop:aspect ref="messageInterceptor">
<aop:around pointcut="execution(* com.atman.cloudknows.chat.connection.HttpLongConnectionImpl.pushMessageToUser(..))" method="invoke"/>
</aop:aspect>
</aop:config>
程序不报任何异常,就是拦截不了