1 22 package org.jboss.test.aop.beforeafter; 23 24 import org.jboss.aop.ConstructorInfo; 25 import org.jboss.aop.FieldInfo; 26 import org.jboss.aop.JoinPointInfo; 27 import org.jboss.aop.MethodInfo; 28 import org.jboss.test.aop.construction.SuperPOJO; 29 30 35 public class ArgsAspect 36 { 37 38 public static String before; 39 public static String after; 40 public static String throwing; 41 42 43 public static void clear() 44 { 45 before = null; 46 after = null; 47 throwing = null; 48 } 49 50 public void before(boolean b, int i) 51 { 52 before = "before1"; 53 } 54 55 public void before(MethodInfo mjp, int i) 56 { 57 before = "before2"; 58 } 59 60 public void before(FieldInfo fjp, int i) 61 { 62 before = "before3"; 63 } 64 65 public void before(FieldInfo fjp) 66 { 67 before = "before4"; 68 } 69 70 public void before(FieldInfo fjp, SubValue val) 71 { 72 before = "before5"; 73 } 74 75 public void before(SubValue sup, SubValue sub) 76 { 77 before = "before6"; 78 } 79 80 public void before(SuperValue sup, SubValue sub) 81 { 82 before = "before7"; 83 } 84 85 public POJO after(MethodInfo mjp, POJO ret, int i, long l) 86 { 87 after = "after1"; 88 return ret; 89 } 90 91 public POJO after(ConstructorInfo cjp, POJO ret) 92 { 93 after = "after2"; 94 return ret; 95 } 96 97 public int after(FieldInfo fp, int i) 99 { 100 after = "after3"; 101 return i; 102 } 103 104 public SubValue after(FieldInfo fp, SubValue ret) 106 { 107 after = "after4"; 108 ret.doubleValue(); 109 return ret; 110 } 111 112 public SuperValue after(SuperValue ret) 114 { 115 after = "after5"; 116 ret.doubleValue(); 117 return ret; 118 } 119 120 public SubValue after(SuperValue ret, SuperValue sup, SuperValue sup2) 121 { 122 throw new RuntimeException ("Should not be called"); 123 } 124 125 public SuperValue after(SuperValue ret, SubValue sup, SuperValue sub) 126 { 127 after = "after6"; 128 ret.doubleValue(); 129 return new SubValue(ret.getValue()); 130 } 131 132 public void after(SuperValue sup, SuperValue sup2) 133 { 134 after = "after7"; 135 } 136 137 public Throwable throwing(Throwable t, int i) 138 { 139 throwing = "throwing1"; 140 return t; 141 } 142 143 public Throwable throwing(MethodInfo mjp, Throwable t) 144 { 145 throwing = "throwing2"; 146 return t; 147 } 148 149 public Throwable throwing(MethodInfo mjp, Throwable t, int i) 150 { 151 throwing = "throwing3"; 152 return t; 153 } 154 } 155 | Popular Tags |