MongoTemplate类有一个嵌套的类-QueryCursorPreparer。我的任务是拦截QueryCursorPreparer.getReadPreference ()方法。我怎么能这样做呢?在尝试执行此操作时:
@Aspect
@Component
public class MongoInterceptor {
@Around("execution(* org.springframework.data.mongodb.core.MongoTemplate.*(..))")
public Object intercept(ProceedingJoinPoint joinPoint) throws Throwable {
System.out.println("TEST");
return joinPoint.proceed();
}
}不会截获任何内容
发布于 2021-05-04 17:58:31
你配置编译后织入了吗?因为您正在尝试建议第三方代码(您并不拥有源代码)。也许这些可能会有所帮助:
https://stackoverflow.com/questions/64854548
复制相似问题