【发布时间】:2011-02-07 14:43:26
【问题描述】:
我正在使用 aspectj 来拦截带有 @Profile(description="something") 注释的方法
@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) {
}
但我在使用 AJC 编译时收到以下错误消息
formal unbound in pointcut
【问题讨论】:
-
嗨,我的要求和你的一样。我怀疑什么是“com.merc.aop.ctw.aspect.PointcutDefinitions.logAnnotatedMethods”。我注意到您创建了 logAnnotatedMethods 但我没有得到 com.merc.aop.ctw.aspect.PointcutDefinitions 是什么?请指导我。
标签: aspectj