Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package concert;
- import org.aspectj.lang.annotation.AfterReturning;
- import org.aspectj.lang.annotation.AfterThrowing;
- import org.aspectj.lang.annotation.Aspect;
- import org.aspectj.lang.annotation.Before;
- @Aspect
- public class Audience {
- @Before( "execution(** concert.Performance.perform(..))" ) /* --> ANTES DEL RENDIMIENTO */
- public void silenceCellPhones() {
- System.out.println( "Silencing cell phones" );
- }
- @Before( "execution(** concert.Performance.perform(..))" ) /* --> ANTES DEL RENDIMIENTO */
- public void takeSeats() {
- System.out.println( "Taking seats" );
- }
- @AfterReturning( "execution(** concert.Performance.perform(..))" ) /* --> DESPUÉS DEL RENDIMIENTO */
- public void applause() {
- System.out.println( "CLAP CLAP CLAP!!!" );
- }
- @AfterThrowing( "execution(** concert.Performance.perform(..))" ) /* --> DESPUÉS DE UN MAL RENDIMIENTO */
- public void demandRefund() {
- System.out.println( "Demanding a refund" ); /
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement