|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.aop.instrument.ConstructorExecutionTransformer
public abstract class ConstructorExecutionTransformer
Comment
Nested Class Summary | |
---|---|
protected class |
ConstructorExecutionTransformer.ConstructorTransformation
|
Field Summary | |
---|---|
protected Codifier |
codifier
|
protected static String |
CONSTRUCTOR_INFO_CLASS_NAME
|
protected static int |
CONSTRUCTOR_STATUS
|
protected Instrumentor |
instrumentor
|
Constructor Summary | |
---|---|
protected |
ConstructorExecutionTransformer(Instrumentor instrumentor)
|
Method Summary | |
---|---|
protected String |
addConstructorInfoField(int modifiers,
javassist.CtClass addTo,
String infoName)
Adds a ConstructorInfo field to the passed in class |
protected String |
addConstructorInfoField(int modifiers,
javassist.CtClass addTo,
String infoName,
javassist.CtField.Initializer init)
Adds a ConstructorInfo field to the passed in class |
protected boolean |
addInfoAsWeakReference()
|
protected void |
buildConstructorWrappers(javassist.CtClass clazz,
ClassAdvisor advisor)
|
void |
codeConverted()
Notifies this transformer that the code conversion is done. |
static String |
constructorFactory(String className)
|
protected static String |
constructorInfoFromWeakReference(String localName,
String ctorInfoName)
|
protected abstract void |
createWrapper(ConstructorExecutionTransformer.ConstructorTransformation trans)
|
protected void |
generateConstructorInfoField(javassist.CtClass clazz,
javassist.CtConstructor constructor,
int index)
|
static String |
getConstructorInfoFieldName(String classname,
int index)
|
protected Instrumentor |
getInstrumentor()
|
protected WrapperTransformer |
getWrapper()
|
protected javassist.CtMethod |
getWrapperMethod(javassist.CtConstructor constructor)
|
protected void |
initialiseWrapper(int mod,
javassist.CtConstructor constructor,
int index)
|
static boolean |
isAdvisableConstructor(javassist.CtConstructor con,
ClassAdvisor advisor)
|
protected boolean |
isAnyConstructorAdvised(javassist.CtClass clazz,
ClassAdvisor advisor)
Returns true if there is at least one constructor that is classified as WRAPPED. |
protected boolean |
markInfoAsSynthetic()
|
boolean |
replaceConstructorAccess(ClassAdvisor sourceAdvisor,
javassist.CtClass source)
|
protected void |
setEmptyWrapperCode(javassist.CtConstructor constructor)
Sets the wrapper method code as an empty wrapper, i.e., a wrapper that simply invokes the constructor. |
protected void |
setEmptyWrapperCodeLater(javassist.CtConstructor constructor)
Sets the wrapper method code as an empty wrapper, i.e., a wrapper that simply invokes the constructor. |
protected void |
setTemporaryWrapperCode(javassist.CtClass type,
javassist.CtMethod wrapperMethod)
Sets a temporary wrapper method code. |
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<Integer> constructorIndexes)
Unwraps the constructor executions contained in constructorIndexes . |
void |
wrap(javassist.CtClass clazz,
Collection<Integer> 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 |
Field Detail |
---|
protected static final String CONSTRUCTOR_INFO_CLASS_NAME
protected Instrumentor instrumentor
protected Codifier codifier
protected static final int CONSTRUCTOR_STATUS
Constructor Detail |
---|
protected ConstructorExecutionTransformer(Instrumentor instrumentor)
Method Detail |
---|
protected Instrumentor getInstrumentor()
protected WrapperTransformer getWrapper()
public static String constructorFactory(String className)
protected String addConstructorInfoField(int modifiers, javassist.CtClass addTo, String infoName) throws javassist.NotFoundException, javassist.CannotCompileException
javassist.NotFoundException
javassist.CannotCompileException
protected String addConstructorInfoField(int modifiers, javassist.CtClass addTo, String infoName, javassist.CtField.Initializer init) throws javassist.NotFoundException, javassist.CannotCompileException
javassist.NotFoundException
javassist.CannotCompileException
protected boolean addInfoAsWeakReference()
protected boolean markInfoAsSynthetic()
public static String getConstructorInfoFieldName(String classname, int index)
protected static String constructorInfoFromWeakReference(String localName, String ctorInfoName)
public boolean transform(javassist.CtClass clazz, ClassAdvisor classAdvisor) throws Exception
AspectManager
.
clazz
- the clazz to be transformed.classAdvisor
- the advisor associated to clazz
.
true
is clazz
is instrumented.
Exception
public void wrap(javassist.CtClass clazz, Collection<Integer> constructorIndexes) throws Exception
constructorIndexes
.
clazz
- the class being instrumented.constructorIndexes
- a collection of java.lang.Integer
indentifying
the constructors to be wrapped.
Exception
public void unwrap(javassist.CtClass clazz, Collection<Integer> constructorIndexes) throws javassist.NotFoundException
constructorIndexes
.
clazz
- the class being instrumented.constructorIndexes
- a collection of java.lang.Integer
indentifying
the constructors to be unwrapped.
javassist.NotFoundException
public void codeConverted() throws javassist.CannotCompileException
javassist.CannotCompileException
public boolean replaceConstructorAccess(ClassAdvisor sourceAdvisor, javassist.CtClass source) throws javassist.NotFoundException
javassist.NotFoundException
protected void buildConstructorWrappers(javassist.CtClass clazz, ClassAdvisor advisor) throws Exception
Exception
protected void generateConstructorInfoField(javassist.CtClass clazz, javassist.CtConstructor constructor, int index) throws javassist.CannotCompileException, javassist.NotFoundException
javassist.CannotCompileException
javassist.NotFoundException
protected void setTemporaryWrapperCode(javassist.CtClass type, javassist.CtMethod wrapperMethod)
type
- wrapperMethod
- protected void setEmptyWrapperCode(javassist.CtConstructor constructor) throws javassist.NotFoundException
type
- the class being instrumented.wrapperMethod
- the wrapper method.
javassist.NotFoundException
protected void setEmptyWrapperCodeLater(javassist.CtConstructor constructor) throws javassist.NotFoundException
type
- the class being instrumented.wrapperMethod
- the wrapper method.
javassist.NotFoundException
protected boolean isAnyConstructorAdvised(javassist.CtClass clazz, ClassAdvisor advisor) throws javassist.NotFoundException
clazz
- the clazz whose constructors will be classified.advisor
- the advisor associated with clazz
true
only if one or more clazz
constructors are
classified as WRAPPED.
javassist.NotFoundException
public static boolean isAdvisableConstructor(javassist.CtConstructor con, ClassAdvisor advisor) throws javassist.NotFoundException
javassist.NotFoundException
protected abstract void createWrapper(ConstructorExecutionTransformer.ConstructorTransformation trans) throws javassist.CannotCompileException, javassist.NotFoundException
javassist.CannotCompileException
javassist.NotFoundException
protected void initialiseWrapper(int mod, javassist.CtConstructor constructor, int index) throws javassist.NotFoundException, javassist.CannotCompileException
javassist.NotFoundException
javassist.CannotCompileException
protected javassist.CtMethod getWrapperMethod(javassist.CtConstructor constructor) throws javassist.NotFoundException
javassist.NotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |