I need to intrecept some methods and their attributes by using annotations as point cuts, but how can I access those method attributes. I have following code that succesfully can run code before method is run, but I just don't know how I can access those attrbiutes.
package my.package;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
@Aspect
public class MyAspect {
@Pointcut(value="execution(public * *(..))")
public void anyPublicMethod() {
}
@Around("anyPublicMethod() && @annotation(myAnnotation )")
public Object myAspect(ProceedingJoinPoint pjp, MyAnnotation myAnnotation)
throws Throwable {
// how can I access method attributes here ?
System.out.println("hello aspect!");
return pjp.proceed();
}
}