I read many question in this forum but nothing works.
public @interface MyAnnotation {
String value() default "";
Class[] exceptionList;
}
@MyAnnotation(value="hello", exceptionList={TimeOutException.class})
public void method() {}
@Aspect
public class MyAspect {
@Around("@annotation(MyAnnotation)")
public Object handle(ProceedingJoinPoint joinPoint, MyAnnotation myAnnotation) {
System.out.println(myAnnotation.exceptionList); // should print out TimeOutException
}
}
How can I get the value
and the exceptionList
of the @MyAnnotation
while executing the advice?
I'm using Spring 4.0.6, AspectJ 1.7.4