1 8 package test.modifier; 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 24 Pointcut call_privateMethod; 25 26 29 Pointcut call_protectedMethod; 30 31 34 Pointcut call_publicMethod; 35 36 39 Pointcut call_staticFinalMethod; 40 41 44 Pointcut execution_privateMethod; 45 46 49 Pointcut execution_protectedMethod; 50 51 54 Pointcut execution_publicMethod; 55 56 59 Pointcut get_privateField; 60 61 64 Pointcut get_protectedField; 65 66 69 Pointcut get_publicField; 70 71 74 Pointcut set_privateField; 75 76 79 Pointcut set_protectedField; 80 81 84 Pointcut set_publicField; 85 86 88 92 public Object advice_CALL(final JoinPoint joinPoint) throws Throwable { 93 ModifierTest.log("call "); 94 Object result = joinPoint.proceed(); 95 ModifierTest.log("call "); 96 return result; 97 } 98 99 102 public Object advice_EXECUTION(final JoinPoint joinPoint) throws Throwable { 103 ModifierTest.log("execution "); 104 Object result = joinPoint.proceed(); 105 ModifierTest.log("execution "); 106 return result; 107 } 108 109 112 public Object advice_SET(final JoinPoint joinPoint) throws Throwable { 113 ModifierTest.log("set "); 114 Object result = joinPoint.proceed(); 115 ModifierTest.log("set "); 116 return result; 117 } 118 119 122 public Object advice_GET(final JoinPoint joinPoint) throws Throwable { 123 ModifierTest.log("get "); 124 Object result = joinPoint.proceed(); 125 ModifierTest.log("get "); 126 return result; 127 } 128 } | Popular Tags |