您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

CallAndMethodSignatureAspect.java 661B

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