|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.aop.instrument.FieldAccessTransformer
Nested Class Summary | |
protected class |
FieldAccessTransformer.FieldAccessExprEditor
|
Field Summary | |
protected static int |
GET_INDEX
|
protected static int |
SET_INDEX
|
protected static String[] |
transformations
|
protected static WrapperTransformer |
wrapper
|
Constructor Summary | |
protected |
FieldAccessTransformer(Instrumentor instrumentor)
|
Method Summary | |
protected String |
addFieldReadInfoFieldWithAccessors(int modifiers,
javassist.CtClass addTo,
javassist.CtField field)
|
protected String |
addFieldReadInfoFieldWithAccessors(int modifiers,
javassist.CtClass addTo,
javassist.CtField field,
javassist.CtField.Initializer init)
Adds a FieldInfo field to the passed in class |
protected String |
addFieldWriteInfoField(int modifiers,
javassist.CtClass addTo,
javassist.CtField field)
|
protected String |
addFieldWriteInfoField(int modifiers,
javassist.CtClass addTo,
javassist.CtField field,
javassist.CtField.Initializer init)
Adds a FieldInfo field to the passed in class |
protected boolean |
addInfoAsWeakReference()
|
protected void |
buildFieldWrappers(javassist.CtClass clazz,
ClassAdvisor advisor)
|
protected javassist.CtMethod |
buildReadWrapperPlaceHolder(javassist.CtClass clazz,
javassist.CtField field,
String wrapperName,
int mod)
Builds the read wrapper place holder for preparation of field read
joinpoint. |
protected void |
buildWrapperPlaceHolders(javassist.CtClass clazz,
javassist.CtField field,
boolean doGet,
boolean doSet,
int mod)
Generate the wrapper place holders. |
protected javassist.CtMethod |
buildWriteWrapperPlaceHolder(javassist.CtClass clazz,
javassist.CtField field,
String wrapperName,
int mod)
Builds the write wrapper place holder for preparation of field read
joinpoint. |
void |
codeConverted()
Notifies this transformer that the code conversion is done. |
protected abstract void |
doBuildFieldWrappers(javassist.CtClass clazz,
javassist.CtField field,
int index,
JoinpointClassification classificationGet,
JoinpointClassification classificationSet)
|
protected static String |
fieldInfoFromWeakReference(String localName,
String fieldInfoName)
|
protected int |
fieldOffset(javassist.CtClass clazz)
|
static String |
fieldRead(String fieldName)
|
static String |
fieldWrite(String fieldName)
|
static String |
getFieldReadInfoFieldName(String fieldName)
|
static String |
getFieldWriteInfoFieldName(String fieldName)
|
protected int |
getStaticModifiers(javassist.CtField field)
|
protected abstract String |
getWrapperBody(javassist.CtClass clazz,
javassist.CtField field,
boolean get,
int fieldIndex)
Returns the wrapper body of the field joinpoint. |
protected javassist.CtMethod |
getWrapperReadMethod(javassist.CtField field,
javassist.CtClass clazz)
|
protected javassist.CtMethod |
getWrapperWriteMethod(javassist.CtField field,
javassist.CtClass clazz)
|
protected boolean |
isPrepared(JoinpointClassification classification)
|
boolean |
replaceFieldAccess(List fields,
javassist.CtClass clazz,
ClassAdvisor fieldsAdvisor)
replace field access for possible public/protected fields that are intercepted don't need to replace access for private fields. |
protected abstract void |
replaceFieldAccessInternally(javassist.CtClass clazz,
javassist.CtField field,
boolean doGet,
boolean doSet,
int index)
This function replaces internal field accesses with bytecode hooks into framework todo this must do it for inherited protected/public fields as well |
void |
unwrap(javassist.CtClass clazz,
Collection fieldsGet,
Collection fieldsSet)
Unwraps the field joinpoints contained in fieldsGet and fieldsSet . |
void |
wrap(javassist.CtClass clazz,
Collection fieldsGet,
Collection fieldsSet)
Wraps the field joinpoints contained in fieldsGet and fieldsSet . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final String[] transformations
protected static final int GET_INDEX
protected static final int SET_INDEX
protected static final WrapperTransformer wrapper
Constructor Detail |
protected FieldAccessTransformer(Instrumentor instrumentor)
Method Detail |
protected void buildFieldWrappers(javassist.CtClass clazz, ClassAdvisor advisor) throws javassist.NotFoundException, javassist.CannotCompileException
javassist.NotFoundException
javassist.CannotCompileException
protected boolean isPrepared(JoinpointClassification classification)
protected abstract void doBuildFieldWrappers(javassist.CtClass clazz, javassist.CtField field, int index, JoinpointClassification classificationGet, JoinpointClassification classificationSet) throws javassist.NotFoundException, javassist.CannotCompileException
javassist.NotFoundException
javassist.CannotCompileException
public boolean replaceFieldAccess(List fields, javassist.CtClass clazz, ClassAdvisor fieldsAdvisor) throws javassist.NotFoundException
clazz
- fieldsAdvisor
-
javassist.NotFoundException
public void wrap(javassist.CtClass clazz, Collection fieldsGet, Collection fieldsSet) throws javassist.CannotCompileException, javassist.NotFoundException
fieldsGet
and fieldsSet
.
clazz
- the class being instrumented.fieldsGet
- a collection of java.lang.Integer
indentifying
the field reads to be wrapped.fieldsSet
- a collection of java.lang.Integer
indentifying
the field writes to be wrapped.
javassist.CannotCompileException
javassist.NotFoundException
protected javassist.CtMethod getWrapperReadMethod(javassist.CtField field, javassist.CtClass clazz) throws javassist.NotFoundException
javassist.NotFoundException
protected javassist.CtMethod getWrapperWriteMethod(javassist.CtField field, javassist.CtClass clazz) throws javassist.NotFoundException
javassist.NotFoundException
public void unwrap(javassist.CtClass clazz, Collection fieldsGet, Collection fieldsSet) throws javassist.CannotCompileException, javassist.NotFoundException
fieldsGet
and fieldsSet
.
clazz
- the class being instrumented.fieldsGet
- a collection of java.lang.Integer
indentifying
the field reads to be unwrapped.fieldsSet
- a collection of java.lang.Integer
indentifying
the field writes to be unwrapped.
javassist.CannotCompileException
javassist.NotFoundException
public void codeConverted() throws javassist.NotFoundException, javassist.CannotCompileException
codeConverted
in interface org.jboss.aop.instrument.CodeConversionObserver
javassist.NotFoundException
javassist.CannotCompileException
protected int fieldOffset(javassist.CtClass clazz) throws javassist.NotFoundException
javassist.NotFoundException
protected String addFieldReadInfoFieldWithAccessors(int modifiers, javassist.CtClass addTo, javassist.CtField field) throws javassist.NotFoundException, javassist.CannotCompileException
javassist.NotFoundException
javassist.CannotCompileException
protected String addFieldReadInfoFieldWithAccessors(int modifiers, javassist.CtClass addTo, javassist.CtField field, javassist.CtField.Initializer init) throws javassist.NotFoundException, javassist.CannotCompileException
javassist.NotFoundException
javassist.CannotCompileException
protected String addFieldWriteInfoField(int modifiers, javassist.CtClass addTo, javassist.CtField field) throws javassist.NotFoundException, javassist.CannotCompileException
javassist.NotFoundException
javassist.CannotCompileException
protected String addFieldWriteInfoField(int modifiers, javassist.CtClass addTo, javassist.CtField field, javassist.CtField.Initializer init) throws javassist.NotFoundException, javassist.CannotCompileException
javassist.NotFoundException
javassist.CannotCompileException
protected boolean addInfoAsWeakReference()
public static String getFieldReadInfoFieldName(String fieldName)
public static String getFieldWriteInfoFieldName(String fieldName)
public static String fieldRead(String fieldName)
public static String fieldWrite(String fieldName)
protected static String fieldInfoFromWeakReference(String localName, String fieldInfoName)
protected int getStaticModifiers(javassist.CtField field)
protected abstract void replaceFieldAccessInternally(javassist.CtClass clazz, javassist.CtField field, boolean doGet, boolean doSet, int index) throws javassist.CannotCompileException
clazz
- field
- doGet
- doSet
- index
-
javassist.CannotCompileException
protected void buildWrapperPlaceHolders(javassist.CtClass clazz, javassist.CtField field, boolean doGet, boolean doSet, int mod) throws javassist.NotFoundException, javassist.CannotCompileException
PS: Removed from inside inner classes to avoid code repetition.
javassist.NotFoundException
javassist.CannotCompileException
protected javassist.CtMethod buildReadWrapperPlaceHolder(javassist.CtClass clazz, javassist.CtField field, String wrapperName, int mod) throws javassist.NotFoundException, javassist.CannotCompileException
field
read
joinpoint.
clazz
- the clazz
to add wrapper tofield
- the field
whose read joinpoint wrapper will be generated.wrapperName
- The name of the field wrapper to be generatedmod
- the modifiers of the generated wrapper.
javassist.NotFoundException
javassist.CannotCompileException
protected javassist.CtMethod buildWriteWrapperPlaceHolder(javassist.CtClass clazz, javassist.CtField field, String wrapperName, int mod) throws javassist.NotFoundException, javassist.CannotCompileException
field
read
joinpoint.
clazz
- the class the wrapper will be added tofield
- the field
whose write joinpoint wrapper will be generated.wrapperName
- The name of the field wrapper to be generatedmod
- the modifiers of the generated wrapper.
javassist.NotFoundException
javassist.CannotCompileException
protected abstract String getWrapperBody(javassist.CtClass clazz, javassist.CtField field, boolean get, int fieldIndex) throws javassist.NotFoundException, javassist.CannotCompileException
field
joinpoint.
clazz
- the class declaring field
.field
- the field whose joinpoint wrapper code will be generated.get
- indicates if the wrapper is a field read wrapper or a field
write wrapper.fieldIndex
- the index of field
.
javassist.NotFoundException
javassist.CannotCompileException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |