You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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. }