KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > weblogic > transform > ServletResponseImplAdapter


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
3  * notice. All rights reserved.
4  */

5 package com.tc.weblogic.transform;
6
7 import com.tc.asm.ClassAdapter;
8 import com.tc.asm.ClassVisitor;
9 import com.tc.asm.MethodVisitor;
10 import com.tc.asm.Opcodes;
11 import com.tc.object.bytecode.ClassAdapterFactory;
12
13 public class ServletResponseImplAdapter extends ClassAdapter implements Opcodes, ClassAdapterFactory {
14
15   public ServletResponseImplAdapter() {
16     super(null);
17   }
18
19   private ServletResponseImplAdapter(ClassVisitor cv, ClassLoader JavaDoc caller) {
20     super(cv);
21   }
22
23   public ClassAdapter create(ClassVisitor visitor, ClassLoader JavaDoc loader) {
24     return new ServletResponseImplAdapter(visitor, loader);
25   }
26
27   public void visit(int version, int access, String JavaDoc name, String JavaDoc signature, String JavaDoc superName, String JavaDoc[] interfaces) {
28     access &= (~ACC_FINAL); // class is final in weblogic 8.1 less than SP6
29
super.visit(version, access, name, signature, superName, interfaces);
30   }
31
32   public MethodVisitor visitMethod(int access, String JavaDoc name, String JavaDoc desc, String JavaDoc signature, String JavaDoc[] exceptions) {
33     if ("<init>".equals(name)) {
34       access |= ACC_PROTECTED;
35     }
36
37     access &= ~ACC_FINAL; // make it possible to delegate all methods in our psuedo-wrapper
38

39     return super.visitMethod(access, name, desc, signature, exceptions);
40   }
41 }
42
Popular Tags