Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. package concert;
  2.  
  3. import org.aspectj.lang.annotation.AfterReturning;
  4. import org.aspectj.lang.annotation.AfterThrowing;
  5. import org.aspectj.lang.annotation.Aspect;
  6. import org.aspectj.lang.annotation.Before;
  7.  
  8. @Aspect
  9. public class Audience {
  10. @Before( "execution(** concert.Performance.perform(..))" ) /* --> ANTES DEL RENDIMIENTO */
  11. public void silenceCellPhones() {
  12. System.out.println( "Silencing cell phones" );
  13. }
  14.  
  15. @Before( "execution(** concert.Performance.perform(..))" ) /* --> ANTES DEL RENDIMIENTO */
  16. public void takeSeats() {
  17. System.out.println( "Taking seats" );
  18. }
  19.  
  20. @AfterReturning( "execution(** concert.Performance.perform(..))" ) /* --> DESPUÉS DEL RENDIMIENTO */
  21. public void applause() {
  22. System.out.println( "CLAP CLAP CLAP!!!" );
  23. }
  24.  
  25. @AfterThrowing( "execution(** concert.Performance.perform(..))" ) /* --> DESPUÉS DE UN MAL RENDIMIENTO */
  26. public void demandRefund() {
  27. System.out.println( "Demanding a refund" ); /
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement