org.jboss.aop.instrument
Class TransformerCommon
java.lang.Object
org.jboss.aop.instrument.TransformerCommon
public class TransformerCommon
- extends Object
A few handy methods and common things used by the other Transformers
- Version:
- $Revision: 1.3 $
- Author:
- Kabir Khan
Method Summary |
static void |
addArgumentFieldsToInvocation(javassist.CtClass invocation,
javassist.CtClass[] params)
Adds fields arg0, arg1 etc. |
static void |
addGetArguments(javassist.ClassPool pool,
javassist.CtClass invocation,
javassist.CtClass[] params)
|
static void |
compileOrLoadClass(javassist.CtClass classForPackage,
javassist.CtClass invocation)
Compiles the class to file or adds it to the class pool |
static javassist.CtClass |
makeInvocationClass(AOPClassPool pool,
boolean makeInnerClass,
javassist.CtClass outerClass,
String className,
javassist.CtClass superInvocation)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TransformerCommon
public TransformerCommon()
makeInvocationClass
public static javassist.CtClass makeInvocationClass(AOPClassPool pool,
boolean makeInnerClass,
javassist.CtClass outerClass,
String className,
javassist.CtClass superInvocation)
throws javassist.CannotCompileException,
javassist.NotFoundException
- Parameters:
pool
- The AOPClassPool to create the optimized invocation class inmakeInnerClass
- If true creates the new class as an inner class of classNameouterClass
- The class to create the invocation class as an inner class of if makeInnerClass==trueclassName
- The full class name (including package info) of the invocation class to be createdsuperInvocation
- The super class of this invocation
- Returns:
- The created invocation class
- Throws:
javassist.CannotCompileException
javassist.NotFoundException
compileOrLoadClass
public static void compileOrLoadClass(javassist.CtClass classForPackage,
javassist.CtClass invocation)
throws Exception
- Compiles the class to file or adds it to the class pool
- Parameters:
classForPackage
- The class to be used to determine the directory to place the class ininvocation
- The class to be comiled/added to class pool
- Throws:
Exception
addArgumentFieldsToInvocation
public static void addArgumentFieldsToInvocation(javassist.CtClass invocation,
javassist.CtClass[] params)
throws javassist.CannotCompileException
- Adds fields arg0, arg1 etc. to the invocation class for storing the parameters for a method
- Parameters:
invocation
- The invocation we want to addparams
- Array of the types of the parameters
- Throws:
javassist.CannotCompileException
addGetArguments
public static void addGetArguments(javassist.ClassPool pool,
javassist.CtClass invocation,
javassist.CtClass[] params)
throws Exception
- Throws:
Exception
Copyright © 2002 JBoss Group, LLC. All Rights Reserved.