jodd.proxetta.asm
Class ProxettaMethodBuilder

java.lang.Object
  extended by jodd.asm.EmptyMethodVisitor
      extended by jodd.proxetta.asm.ProxettaMethodBuilder
All Implemented Interfaces:
org.objectweb.asm.MethodVisitor

public class ProxettaMethodBuilder
extends EmptyMethodVisitor


Field Summary
protected  java.util.List<jodd.proxetta.asm.ProxyAspectData> aspectList
           
protected  MethodSignatureVisitor msign
           
protected  org.objectweb.asm.MethodVisitor mv
           
static java.lang.String TARGET_CLASS_NAME
           
protected  jodd.proxetta.asm.TargetMethodData tmd
           
protected  jodd.proxetta.asm.WorkData wd
           
 
Constructor Summary
ProxettaMethodBuilder(MethodSignatureVisitor msign, jodd.proxetta.asm.WorkData wd, java.util.List<jodd.proxetta.asm.ProxyAspectData> aspectList)
           
 
Method Summary
protected  void createFirstChainDelegate_Continue(jodd.proxetta.asm.TargetMethodData td)
          Continues the creation of the very first method in calling chain that simply delegates invocation to the first proxy method.
protected  void createFirstChainDelegate_Start()
          Starts creation of first chain delegate.
 void createProxyMethod(jodd.proxetta.asm.TargetMethodData td)
          Creates proxy methods over target method, For each matched proxy, new proxy method is created by taking advice bytecode and replaces usages of ProxyTarget.
 org.objectweb.asm.AnnotationVisitor visitAnnotation(java.lang.String desc, boolean visible)
          Copies target method annotations
 org.objectweb.asm.AnnotationVisitor visitAnnotationDefault()
          Visits the default value of this annotation interface method.
 void visitEnd()
          Finally, builds proxy methods if applied to current method.
 org.objectweb.asm.AnnotationVisitor visitParameterAnnotation(int parameter, java.lang.String desc, boolean visible)
          Visits an annotation of a parameter this method.
 
Methods inherited from class jodd.asm.EmptyMethodVisitor
visitAttribute, visitCode, visitFieldInsn, visitFrame, visitIincInsn, visitInsn, visitIntInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLookupSwitchInsn, visitMaxs, visitMethodInsn, visitMultiANewArrayInsn, visitTableSwitchInsn, visitTryCatchBlock, visitTypeInsn, visitVarInsn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TARGET_CLASS_NAME

public static final java.lang.String TARGET_CLASS_NAME

msign

protected final MethodSignatureVisitor msign

wd

protected final jodd.proxetta.asm.WorkData wd

aspectList

protected final java.util.List<jodd.proxetta.asm.ProxyAspectData> aspectList

tmd

protected jodd.proxetta.asm.TargetMethodData tmd

mv

protected org.objectweb.asm.MethodVisitor mv
Constructor Detail

ProxettaMethodBuilder

public ProxettaMethodBuilder(MethodSignatureVisitor msign,
                             jodd.proxetta.asm.WorkData wd,
                             java.util.List<jodd.proxetta.asm.ProxyAspectData> aspectList)
Method Detail

visitAnnotation

public org.objectweb.asm.AnnotationVisitor visitAnnotation(java.lang.String desc,
                                                           boolean visible)
Copies target method annotations

Specified by:
visitAnnotation in interface org.objectweb.asm.MethodVisitor
Overrides:
visitAnnotation in class EmptyMethodVisitor
Parameters:
desc - the class descriptor of the annotation class.
visible - true if the annotation is visible at runtime.
Returns:
a visitor to visit the annotation values, or null if this visitor is not interested in visiting this annotation.

visitAnnotationDefault

public org.objectweb.asm.AnnotationVisitor visitAnnotationDefault()
Description copied from class: EmptyMethodVisitor
Visits the default value of this annotation interface method.

Specified by:
visitAnnotationDefault in interface org.objectweb.asm.MethodVisitor
Overrides:
visitAnnotationDefault in class EmptyMethodVisitor
Returns:
a visitor to the visit the actual default value of this annotation interface method, or null if this visitor is not interested in visiting this default value. The 'name' parameters passed to the methods of this annotation visitor are ignored. Moreover, exacly one visit method must be called on this annotation visitor, followed by visitEnd.

visitParameterAnnotation

public org.objectweb.asm.AnnotationVisitor visitParameterAnnotation(int parameter,
                                                                    java.lang.String desc,
                                                                    boolean visible)
Description copied from class: EmptyMethodVisitor
Visits an annotation of a parameter this method.

Specified by:
visitParameterAnnotation in interface org.objectweb.asm.MethodVisitor
Overrides:
visitParameterAnnotation in class EmptyMethodVisitor
Parameters:
parameter - the parameter index.
desc - the class descriptor of the annotation class.
visible - true if the annotation is visible at runtime.
Returns:
a visitor to visit the annotation values, or null if this visitor is not interested in visiting this annotation.

visitEnd

public void visitEnd()
Finally, builds proxy methods if applied to current method.

Specified by:
visitEnd in interface org.objectweb.asm.MethodVisitor
Overrides:
visitEnd in class EmptyMethodVisitor

createFirstChainDelegate_Start

protected void createFirstChainDelegate_Start()
Starts creation of first chain delegate.


createFirstChainDelegate_Continue

protected void createFirstChainDelegate_Continue(jodd.proxetta.asm.TargetMethodData td)
Continues the creation of the very first method in calling chain that simply delegates invocation to the first proxy method. This method mirrors the target method.


createProxyMethod

public void createProxyMethod(jodd.proxetta.asm.TargetMethodData td)
Creates proxy methods over target method, For each matched proxy, new proxy method is created by taking advice bytecode and replaces usages of ProxyTarget.

Invocation chain example: name -> name$p0 -> name$p1 -> name$p4 -> super



Copyright © 2003-2010 Jodd Team