1 8 package test.annotation; 9 10 import org.codehaus.aspectwerkz.definition.Pointcut; 11 import org.codehaus.aspectwerkz.definition.Pointcut; 12 import org.codehaus.aspectwerkz.joinpoint.JoinPoint; 13 14 18 public class TestAspect { 19 21 25 Pointcut call_privateMethod; 26 27 30 Pointcut execution_privateMethod; 31 32 36 Pointcut call_protectedMethod; 37 38 41 Pointcut execution_protectedMethod; 42 43 47 Pointcut call_packagePrivateMethod; 48 49 52 Pointcut execution_packagePrivateMethod; 53 54 58 Pointcut call_publicMethod; 59 60 63 Pointcut execution_publicMethod; 64 65 68 Pointcut execution_publicMethod2; 69 70 73 Pointcut get_privateField; 74 75 78 Pointcut set_privateField; 79 80 83 Pointcut get_protectedField; 84 85 88 Pointcut set_protectedField; 89 90 93 Pointcut get_packagePrivateField; 94 95 98 Pointcut set_packagePrivateField; 99 100 103 Pointcut get_publicField; 104 105 108 Pointcut set_publicField; 109 110 112 116 public Object advice_CALL(final JoinPoint joinPoint) throws Throwable { 117 AnnotationTest.log("call "); 118 Object result = joinPoint.proceed(); 119 AnnotationTest.log("call "); 120 return result; 121 } 122 123 127 public Object advice_EXECUTION(final JoinPoint joinPoint) throws Throwable { 128 AnnotationTest.log("execution "); 129 Object result = joinPoint.proceed(); 130 AnnotationTest.log("execution "); 131 return result; 132 } 133 134 137 public Object advice_EXECUTION2(final JoinPoint joinPoint) throws Throwable { 138 AnnotationTest.log("execution2 "); 139 Object result = joinPoint.proceed(); 140 AnnotationTest.log("execution2 "); 141 return result; 142 } 143 144 147 public Object advice_SET(final JoinPoint joinPoint) throws Throwable { 148 AnnotationTest.log("set "); 149 Object result = joinPoint.proceed(); 150 AnnotationTest.log("set "); 151 return result; 152 } 153 154 157 public Object advice_GET(final JoinPoint joinPoint) throws Throwable { 158 AnnotationTest.log("get "); 159 Object result = joinPoint.proceed(); 160 AnnotationTest.log("get "); 161 return result; 162 } 163 } | Popular Tags |