我使用AspectJ攔截被註解爲@Profile(description="something")
與註釋AspectJ切入點參數
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Profile {
public String description() default "";
}
@Around("com.merc.aop.ctw.aspect.PointcutDefinitions.logAnnotatedMethods(profile)")
public Object profile(ProceedingJoinPoint pjp, Profile profile) throws Throwable {
....
}
@Pointcut("@annotation(com.merc.annotations.Profile)")
protected void logAnnotatedMethods(Profile profile) {
}
方法,但同時compileing使用AJC
formal unbound in pointcut
嗨,我的要求和你一樣。我有一個疑問是什麼是'com.merc.aop.ctw.aspect.PointcutDefinitions.logAnnotatedMethods'。我注意到,你創建的logAnnotatedMethods,但我沒有得到什麼是com.merc.aop.ctw.aspect.PointcutDefinitions?請指導我。 – James 2015-07-07 18:19:13