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.

Code2.java 742B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import org.aspectj.lang.annotation.*;
  2. import java.lang.annotation.*;
  3. import java.lang.reflect.*;
  4. import org.aspectj.lang.*;
  5. @Aspect("perthis(transactional())")
  6. public class Code2 {
  7. @Pointcut("execution(@Transactional * * (..))")
  8. public void transactional() { }
  9. @Before("execution(* *(..))")
  10. public void m(JoinPoint.StaticPart thisJoinPointStaticPart) {
  11. System.out.println(thisJoinPointStaticPart);
  12. }
  13. public static void main(String[] args) {
  14. new AAA().m();
  15. new BBB().m();
  16. new CCC().m();
  17. }
  18. }
  19. class AAA {
  20. public void m() { }
  21. }
  22. class BBB {
  23. public void m() { }
  24. }
  25. class CCC {
  26. @Transactional
  27. public void m() { }
  28. }
  29. @Retention(RetentionPolicy.RUNTIME) @interface Transactional {}