Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. package concert;
  2.  
  3. import org.aspectj.lang.ProceedingJoinPoint;
  4.  
  5. public class Audience {
  6. public void watchPerformance( ProceedingJoinPoint jp ) {
  7. try {
  8. /* Before perfomance */
  9. System.out.println( "Silencing cell phones" );
  10. System.out.println( "Taking seats" );
  11.  
  12. /* Proceder al método advised */
  13. jp.proceed();
  14.  
  15. /* Before perfomance */
  16. System.out.println( "CLAP CLAP CLAP!!!" );
  17. } catch ( Throwable e ) {
  18.  
  19. /* After bad perfomance */
  20. System.out.println( "Demanding a refund" );
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement