blob: 2f8e8cf863d8c1370c78f5fb1182819c63460088 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import org.aspectj.lang.reflect.*;
import java.lang.reflect.*;
public aspect CallAndMethodSignatureAspect {
pointcut callAnyPublicMethodInAuthorization() : call(public * Authorization+.*(..) );
Object around() : callAnyPublicMethodInAuthorization() {
MethodSignature methodSignature = (MethodSignature) thisJoinPoint.getSignature();
// returns NULL when calling a method defined in the top interface "Authorization"
Method method = methodSignature.getMethod();
System.out.println(method);
System.out.println(methodSignature.toLongString());
return proceed();
}
}
|