2014-02-07 2 views
2

저는 스프링 AOP를 사용하여 메소드를 가로 채고 있습니다. 스프링 구성 파일에 다음과 같은 구성이 있습니다.봄 AOP 측면을 사용하여 메서드를 가로채는 중입니까?

<aop:aspectj-autoproxy /> 

화면 클래스 : 방법 위

@Aspect 
public class MyAspect{ 

@Around("execution(public * *(..))") 
public Object doAction(ProceedingJoinPoint call) throws Throwable { 

//somelogic 
} 

개인 방법을 차단하지 않는 이유는 무엇입니까? 무엇을 가로 채기를해야합니까? 개인공개 방법?

답변

5

개인용 메서드는 프록시를 통해 호출 할 수 없으므로 가로 채지 못할 수 있습니다.

http://docs.spring.io/spring/docs/4.0.0.RELEASE/spring-framework-reference/html/aop.html#aop-pointcuts-designators

+0

안드레스, 어떤 대안을 개인 방법을 가로 채기 위해 : 당신이 다음 페이지의 포인트 8.8.4에 볼 수

그러나, 기본 AspectJ의 직물을 사용할 수 있을까? 감사! – user3269829

+0

AspectJ 길쌈 사용 http://docs.spring.io/spring/docs/3.0.0.RC2/reference/html/ch07s08.html – Andres

+0

주석을 사용하여 AspectJ를 사용할 수 있습니까? – user3269829

관련 문제