org.jboss.aop.instrument
Class ConstructorExecutionTransformer

java.lang.Object
  extended by org.jboss.aop.instrument.ConstructorExecutionTransformer

public class ConstructorExecutionTransformer
extends Object

Comment

Version:
$Revision: 1.16 $
Author:
Bill Burke

Constructor Summary
ConstructorExecutionTransformer(Instrumentor instrumentor, AspectManager manager)
           
 
Method Summary
 void buildConstructorWrappers(javassist.CtClass clazz, ClassAdvisor advisor)
           
 void codeConverted()
          Notifies this transformer that the code conversion is done.
static String constructorFactory(String className)
           
protected  String createOptimizedInvocationClass(javassist.CtClass clazz, javassist.CtConstructor con, int index)
           
static boolean isAdvisableConstructor(javassist.CtConstructor con, ClassAdvisor advisor)
           
 boolean replaceConstructorAccess(ClassAdvisor sourceAdvisor, javassist.CtClass source)
           
 boolean transform(javassist.CtClass clazz, ClassAdvisor classAdvisor)
          Transforms the constructor executions of this class according to the pointcuts registered in AspectManager.
 void unwrap(javassist.CtClass clazz, Collection constructorIndexes)
          Unwraps the constructor executions contained in constructorIndexes.
 void wrap(javassist.CtClass clazz, Collection constructorIndexes)
          Wraps the constructor executions contained in constructorIndexes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstructorExecutionTransformer

public ConstructorExecutionTransformer(Instrumentor instrumentor,
                                       AspectManager manager)
Method Detail

constructorFactory

public static String constructorFactory(String className)

transform

public boolean transform(javassist.CtClass clazz,
                         ClassAdvisor classAdvisor)
                  throws Exception
Transforms the constructor executions of this class according to the pointcuts registered in AspectManager.

Parameters:
clazz - the clazz to be transformed.
classAdvisor - the advisor associated to clazz.
Returns:
true is clazz is instrumented.
Throws:
Exception

wrap

public void wrap(javassist.CtClass clazz,
                 Collection constructorIndexes)
          throws Exception
Wraps the constructor executions contained in constructorIndexes.

Parameters:
clazz - the class being instrumented.
constructorIndexes - a collection of java.lang.Integer indentifying the constructors to be wrapped.
Throws:
Exception

unwrap

public void unwrap(javassist.CtClass clazz,
                   Collection constructorIndexes)
            throws javassist.NotFoundException
Unwraps the constructor executions contained in constructorIndexes.

Parameters:
clazz - the class being instrumented.
constructorIndexes - a collection of java.lang.Integer indentifying the constructors to be unwrapped.
Throws:
javassist.NotFoundException

codeConverted

public void codeConverted()
                   throws javassist.CannotCompileException
Notifies this transformer that the code conversion is done.

Throws:
javassist.CannotCompileException

replaceConstructorAccess

public boolean replaceConstructorAccess(ClassAdvisor sourceAdvisor,
                                        javassist.CtClass source)
                                 throws javassist.NotFoundException
Throws:
javassist.NotFoundException

buildConstructorWrappers

public void buildConstructorWrappers(javassist.CtClass clazz,
                                     ClassAdvisor advisor)
                              throws Exception
Throws:
Exception

isAdvisableConstructor

public static boolean isAdvisableConstructor(javassist.CtConstructor con,
                                             ClassAdvisor advisor)
                                      throws javassist.NotFoundException
Throws:
javassist.NotFoundException

createOptimizedInvocationClass

protected String createOptimizedInvocationClass(javassist.CtClass clazz,
                                                javassist.CtConstructor con,
                                                int index)
                                         throws Exception
Throws:
Exception


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.