1 8 package test.aspect; 9 10 import test.CallerSideAdviceTest; 11 import org.codehaus.aspectwerkz.definition.Pointcut; 12 import org.codehaus.aspectwerkz.definition.Pointcut; 13 import org.codehaus.aspectwerkz.joinpoint.JoinPoint; 14 15 19 public class CallerSideTestAspect { 20 22 26 Pointcut pc1; 27 28 32 Pointcut pc2; 33 34 38 Pointcut pc3; 39 40 44 Pointcut pc4; 45 46 50 Pointcut pc5; 51 52 56 Pointcut pc6; 57 58 62 Pointcut pc7; 63 64 68 Pointcut pc8; 69 70 72 75 public void preAdvice1(final JoinPoint joinPoint) throws Throwable { 76 CallerSideAdviceTest.log("pre1 "); 77 } 78 79 82 public void preAdvice2(final JoinPoint joinPoint) throws Throwable { 83 CallerSideAdviceTest.log("pre2 "); 84 } 85 86 89 public void postAdvice1(final JoinPoint joinPoint) throws Throwable { 90 CallerSideAdviceTest.log("post1 "); 91 } 92 93 96 public void postAdvice2(final JoinPoint joinPoint) throws Throwable { 97 CallerSideAdviceTest.log("post2 "); 98 } 99 100 103 public Object around(final JoinPoint joinPoint) throws Throwable { 104 CallerSideAdviceTest.log("before "); 105 Object result = joinPoint.proceed(); 106 CallerSideAdviceTest.log("after "); 107 return result; 108 } 109 } | Popular Tags |