다른 클래스의 특정 메서드가 호출 될 때 메서드를 트리거하려고합니다. 그 이유는 @Pointcut을 사용하려고 생각한 이유입니다.스프링 AOP @Pointcut 트리거링을하지 않음
아래의 코드는 내가 코딩하고있는 코드와 거의 동일하므로 추가 할 부분이 없습니다.
@Aspect
public class OrgManagerSynchronizer {
@Pointcut("execution(* com.alvin.OrgManager.getOrg(..))")
public void classMethods() {}
@Before("classMethods()")
public void synchronize(JoinPoint jp) {
//code should be executed. but does not execute.
}
}
내 .XML에서
이 지정되었다 :aop:aspectj-autoproxy
더 내가 추가해야
public class OrgManagerImpl implements OrgManager {
public IOrg getOrg(String orgShortName) {
}
}
이 트리거해야하는 클래스이다? 다음에 무엇을할지?
매번, 그것은) (AOP의 부분은 getOrg로 직접 이동 건너; – Alvin
'component : scan'에'OrgManagerSynchronizer'를 추가 했습니까? – xyz
xml 구성을 게시 할 수 있습니까? OrgManagerImpl이 Spring 빈인지 여부를 확인하십시오. –