我使用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