1 8 package test.aspect; 9 10 import test.Loggable; 11 import org.codehaus.aspectwerkz.definition.Pointcut; 12 import org.codehaus.aspectwerkz.definition.Pointcut; 13 import org.codehaus.aspectwerkz.joinpoint.JoinPoint; 14 15 23 public class DynamicDeploymentTestAspect { 24 26 29 Pointcut pc1; 30 31 34 Pointcut pc2; 35 36 39 Pointcut pc3; 40 41 44 Pointcut pc4; 45 46 48 51 public Object advice1(final JoinPoint joinPoint) throws Throwable { 52 ((Loggable) joinPoint.getTarget()).log("before1 "); 53 final Object result = joinPoint.proceed(); 54 ((Loggable) joinPoint.getTarget()).log("after1 "); 55 return result; 56 } 57 58 61 public Object advice2(final JoinPoint joinPoint) throws Throwable { 62 ((Loggable) joinPoint.getTarget()).log("before2 "); 63 final Object result = joinPoint.proceed(); 64 ((Loggable) joinPoint.getTarget()).log("after2 "); 65 return result; 66 } 67 } | Popular Tags |