Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

CallAndMethodSignatureAspect.java 661B

15 anos atrás
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. }