I created an Aspect with a pointcut to annotated method. What I get as JoinPoint is method declaration from Interface not method implementation. So when I want to get annotated method parameters I have to add annotation in interface not in implementation.
@AfterReturning(value = "@annotation(pl.styall.scylla.security.authorization.acl.AclSecure) && @annotation(aclSecure)", argNames = "jp,aclSecure,retVal", returning = "retVal")
public void addObjectAndEntry(JoinPoint jp, AclSecure aclSecure,
Object retVal) {
System.out.println(jp.toLongString());
MethodSignature signature = (MethodSignature) jp.getSignature();
Method method = signature.getMethod();
Annotation[][] methodAnnotations = method.getParameterAnnotations();
methodAnnotations has no annotations if they are add in method implementation. What would be the correct pointcut?
Source: Spring AOP: how to get the annotations of the adviced method