org.jboss.aop.instrument
Class FieldAccessTransformer

java.lang.Object
  extended byorg.jboss.aop.instrument.FieldAccessTransformer
All Implemented Interfaces:
org.jboss.aop.instrument.CodeConversionObserver

public class FieldAccessTransformer
extends Object
implements org.jboss.aop.instrument.CodeConversionObserver

Author:
Kabir Khan

Constructor Summary
FieldAccessTransformer(Instrumentor instrumentor)
           
 
Method Summary
 void buildFieldWrappers(javassist.CtClass clazz, ClassAdvisor advisor)
           
 void codeConverted()
          Notifies this transformer that the code conversion is done.
 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.
 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
 

Constructor Detail

FieldAccessTransformer

public FieldAccessTransformer(Instrumentor instrumentor)
Method Detail

buildFieldWrappers

public void buildFieldWrappers(javassist.CtClass clazz,
                               ClassAdvisor advisor)
                        throws javassist.NotFoundException,
                               javassist.CannotCompileException
Throws:
javassist.NotFoundException
javassist.CannotCompileException

replaceFieldAccess

public boolean replaceFieldAccess(List fields,
                                  javassist.CtClass clazz,
                                  ClassAdvisor fieldsAdvisor)
                           throws javassist.NotFoundException
replace field access for possible public/protected fields that are intercepted don't need to replace access for private fields.

Parameters:
clazz -
fieldsAdvisor -
Returns:
Throws:
javassist.NotFoundException

wrap

public void wrap(javassist.CtClass clazz,
                 Collection fieldsGet,
                 Collection fieldsSet)
          throws javassist.CannotCompileException,
                 javassist.NotFoundException
Wraps the field joinpoints contained in fieldsGet and fieldsSet.

Parameters:
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.
Throws:
javassist.CannotCompileException
javassist.NotFoundException

unwrap

public void unwrap(javassist.CtClass clazz,
                   Collection fieldsGet,
                   Collection fieldsSet)
            throws javassist.CannotCompileException,
                   javassist.NotFoundException
Unwraps the field joinpoints contained in fieldsGet and fieldsSet.

Parameters:
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.
Throws:
javassist.CannotCompileException
javassist.NotFoundException

codeConverted

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

Specified by:
codeConverted in interface org.jboss.aop.instrument.CodeConversionObserver
Throws:
javassist.NotFoundException
javassist.CannotCompileException


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