org.apache.aries.proxy.impl.common
Class OSGiFriendlyClassWriter

java.lang.Object
  extended by org.objectweb.asm.ClassWriter
      extended by org.apache.aries.proxy.impl.common.OSGiFriendlyClassWriter
All Implemented Interfaces:
org.objectweb.asm.ClassVisitor

public final class OSGiFriendlyClassWriter
extends org.objectweb.asm.ClassWriter

We need to override ASM's default behaviour in getCommonSuperClass(String, String) so that it doesn't load classes (which it was doing on the wrong ClassLoader anyway...)


Field Summary
 
Fields inherited from class org.objectweb.asm.ClassWriter
COMPUTE_FRAMES, COMPUTE_MAXS
 
Constructor Summary
OSGiFriendlyClassWriter(org.objectweb.asm.ClassReader arg0, int arg1, ClassLoader loader)
           
OSGiFriendlyClassWriter(int arg0, ClassLoader loader)
           
 
Method Summary
protected  String getCommonSuperClass(String arg0, String arg1)
          We provide an implementation that doesn't cause class loads to occur.
 void visit(int arg0, int arg1, String arg2, String arg3, String arg4, String[] arg5)
          We need access to the super's name and our class name
 org.objectweb.asm.MethodVisitor visitMethod(int arg0, String arg1, String arg2, String arg3, String[] arg4)
           
 
Methods inherited from class org.objectweb.asm.ClassWriter
newClass, newConst, newField, newMethod, newNameType, newUTF8, toByteArray, visitAnnotation, visitAttribute, visitEnd, visitField, visitInnerClass, visitOuterClass, visitSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OSGiFriendlyClassWriter

public OSGiFriendlyClassWriter(org.objectweb.asm.ClassReader arg0,
                               int arg1,
                               ClassLoader loader)

OSGiFriendlyClassWriter

public OSGiFriendlyClassWriter(int arg0,
                               ClassLoader loader)
Method Detail

getCommonSuperClass

protected final String getCommonSuperClass(String arg0,
                                           String arg1)
We provide an implementation that doesn't cause class loads to occur. It may not be sufficient because it expects to find the common parent using a single classloader, though in fact the common parent may only be loadable by another bundle from which an intermediate class is loaded

Overrides:
getCommonSuperClass in class org.objectweb.asm.ClassWriter

visit

public final void visit(int arg0,
                        int arg1,
                        String arg2,
                        String arg3,
                        String arg4,
                        String[] arg5)
We need access to the super's name and our class name

Specified by:
visit in interface org.objectweb.asm.ClassVisitor
Overrides:
visit in class org.objectweb.asm.ClassWriter

visitMethod

public org.objectweb.asm.MethodVisitor visitMethod(int arg0,
                                                   String arg1,
                                                   String arg2,
                                                   String arg3,
                                                   String[] arg4)
Specified by:
visitMethod in interface org.objectweb.asm.ClassVisitor
Overrides:
visitMethod in class org.objectweb.asm.ClassWriter


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.