1 8 package test.proceedinnewthread; 9 10 import org.codehaus.aspectwerkz.joinpoint.JoinPoint; 11 12 15 public class TestAspect { 16 17 public Object advice1(final JoinPoint jp) throws Throwable { 18 Thread t = new Thread ( 19 new Runnable () { 20 public void run() { 21 try { 22 ProceedTest.LOG += "advice1Pre "; 23 jp.proceed(); 24 ProceedTest.LOG += "advice1Post "; 25 } catch (Throwable e) { 26 throw new RuntimeException (e.toString()); 27 } 28 } 29 } 30 ); 31 t.setPriority(Thread.MAX_PRIORITY); 35 t.start(); 36 return null; 37 } 38 39 public Object advice2(final JoinPoint jp) throws Throwable { 40 ProceedTest.LOG += "advice2Pre "; 41 jp.proceed(); 42 ProceedTest.LOG += "advice2Post "; 43 return null; 44 } 45 46 public Object advice3(final JoinPoint jp) throws Throwable { 47 ProceedTest.LOG += "advice3Pre "; 48 jp.proceed(); 49 ProceedTest.LOG += "advice3Post "; 50 return null; 51 } 52 } 53 | Popular Tags |