1 16 package org.mortbay.j2ee.session; 17 18 20 import java.rmi.RemoteException ; 21 import java.util.Enumeration ; 22 import java.util.Map ; 23 24 26 27 public abstract class AroundInterceptor 28 extends StateInterceptor 29 { 30 protected abstract void before(); 31 protected abstract void after(); 32 33 public long 34 getCreationTime() 35 throws RemoteException 36 { 37 long tmp=0; 38 39 before(); 40 try 41 { 42 tmp=super.getCreationTime(); 43 } 44 finally 45 { 46 after(); 47 } 48 49 return tmp; 50 } 51 52 public String 53 getId() 54 throws RemoteException 55 { 56 String tmp=null; 57 58 before(); 59 try 60 { 61 tmp=super.getId(); 62 } 63 finally 64 { 65 after(); 66 } 67 68 return tmp; 69 } 70 71 public void 72 setLastAccessedTime(long time) 73 throws RemoteException 74 { 75 before(); 76 try 77 { 78 super.setLastAccessedTime(time); 79 } 80 finally 81 { 82 after(); 83 } 84 } 85 86 public long 87 getLastAccessedTime() 88 throws RemoteException 89 { 90 long tmp=0; 91 92 before(); 93 try 94 { 95 tmp=super.getLastAccessedTime(); 96 } 97 finally 98 { 99 after(); 100 } 101 102 return tmp; 103 } 104 105 public void 106 setMaxInactiveInterval(int interval) 107 throws RemoteException 108 { 109 before(); 110 try 111 { 112 super.setMaxInactiveInterval(interval); 113 } 114 finally 115 { 116 after(); 117 } 118 } 119 120 public int 121 getMaxInactiveInterval() 122 throws RemoteException 123 { 124 int tmp=0; 125 126 before(); 127 try 128 { 129 tmp=super.getMaxInactiveInterval(); 130 } 131 finally 132 { 133 after(); 134 } 135 136 return tmp; 137 } 138 139 public Object 140 getAttribute(String name) 141 throws RemoteException 142 { 143 Object tmp=null; 144 145 before(); 146 try 147 { 148 tmp=super.getAttribute(name); 149 } 150 finally 151 { 152 after(); 153 } 154 155 return tmp; 156 } 157 158 public Enumeration 159 getAttributeNameEnumeration() 160 throws RemoteException 161 { 162 Enumeration tmp=null; 163 164 before(); 165 try 166 { 167 tmp=super.getAttributeNameEnumeration(); 168 } 169 finally 170 { 171 after(); 172 } 173 174 return tmp; 175 } 176 177 public String [] 178 getAttributeNameStringArray() 179 throws RemoteException 180 { 181 String [] tmp=null; 182 183 before(); 184 try 185 { 186 tmp=super.getAttributeNameStringArray(); 187 } 188 finally 189 { 190 after(); 191 } 192 193 return tmp; 194 } 195 196 public Object 197 setAttribute(String name, Object value, boolean returnValue) 198 throws RemoteException 199 { 200 Object tmp=null; 201 202 before(); 203 try 204 { 205 tmp=super.setAttribute(name, value, returnValue); 206 } 207 finally 208 { 209 after(); 210 } 211 212 return tmp; 213 } 214 215 public Object 216 removeAttribute(String name, boolean returnValue) 217 throws RemoteException 218 { 219 Object tmp=null; 220 221 before(); 222 try 223 { 224 tmp=super.removeAttribute(name, returnValue); 225 } 226 finally 227 { 228 after(); 229 } 230 231 return tmp; 232 } 233 234 public Map 235 getAttributes() 236 throws RemoteException 237 { 238 Map tmp=null; 239 240 before(); 241 try 242 { 243 tmp=super.getAttributes(); 244 } 245 finally 246 { 247 after(); 248 } 249 250 return tmp; 251 } 252 253 public void 254 setAttributes(Map attributes) 255 throws RemoteException 256 { 257 before(); 258 try 259 { 260 super.setAttributes(attributes); 261 } 262 finally 263 { 264 after(); 265 } 266 } 267 } 268 | Popular Tags |