1 22 package org.jboss.test.aop.beforeafter; 23 24 import org.jboss.aop.joinpoint.Invocation; 25 26 31 public class SimpleAspect 32 { 33 public static boolean before; 34 public static boolean around; 35 public static boolean after; 36 public static boolean throwing; 37 38 public static void clear() 39 { 40 before = false; 41 around = false; 42 after = false; 43 throwing = false; 44 } 45 46 public void before() 47 { 48 System.out.println("SimpleAspect.before"); 49 before = true; 50 } 51 52 public Object around(Invocation invocation) throws Throwable 53 { 54 System.out.println("SimpleAspect.around"); 55 around = true; 56 return invocation.invokeNext(); 57 } 58 59 public int after(int i) 61 { 62 System.out.println("SimpleAspect.after"); 63 after = true; 64 return i; 65 } 66 67 public void throwing(Throwable t) 68 { 69 System.out.println("SimpleAspect.throwing"); 70 throwing = true; 71 } 72 73 } 74 | Popular Tags |