| java.lang.Object ch.ethz.inf.iks.jvmai.jvmdi.HotSwapSimpleClassWeaver
HotSwapSimpleClassWeaver | public class HotSwapSimpleClassWeaver (Code) | | Modifies a given class to support advice execution.
Container for MethodWeavers, which does the code
manipulations. Use the static method
HotSwapSimpleClassWeaver.getWeaver(Member) to get an instance of an
ch.ethz.jvmai.MethodWeaver .
Simple Class Weaver implementation:
Holds one list with all used ClassWeavers. On
commit all ClassWeavers in the list
are checked, to know if they must be woven or not.
A ClassWeaver represents a class that will be instrumented
with bytecode instructions.
author: Angela Nicoara author: Gerald Linhofer version: $Revision$ |
JVMAI_CLASS | final public static String JVMAI_CLASS(Code) | | String representation of the JVMAI class.
|
WEAVER_STATUS_INITIALIZED | final public static int WEAVER_STATUS_INITIALIZED(Code) | | |
WEAVER_STATUS_MODIFIED | final public static int WEAVER_STATUS_MODIFIED(Code) | | |
WEAVER_STATUS_UNINITIALIZED | final public static int WEAVER_STATUS_UNINITIALIZED(Code) | | |
WEAVER_STATUS_WOVEN | final public static int WEAVER_STATUS_WOVEN(Code) | | |
WEAVER_UNCHANGED_MASK | final public static int WEAVER_UNCHANGED_MASK(Code) | | |
targetClass | final public Class targetClass(Code) | | Class bound to this weaver
|
commit | public static void commit()(Code) | | (Re-)Weaves all modified classes and activates them.
|
getWeaver | public static MethodWeaver getWeaver(Member target)(Code) | | Get a unique method weaver for 'target'.
Parameters: target - method for which a method weaver will be returned. MethodWeaver associated to target . |
hasStatus | protected boolean hasStatus(int type)(Code) | | Indicates if type was set in classStatus .
Parameters: type - 'true' if the status is set |
idToMethod | public static Member idToMethod(int methodId)(Code) | | Returns the Member object associated to methodId
or null , if methodID is not a valid
id.
Parameters: methodId - id for the Method that will be returned. Method associated to methodID or null . throws: ArrayOutOfBoundException - |
redefineClass | public static void redefineClass(Class cl, byte[] definition)(Code) | | Redefines an existing class, actually only method bodies may be redefined,
but the JVMDI and JVMTI functions requieres the whole class code.
The class that should be redefined must exist in the JVM (they must be loaded
in advance).
Required for JVMDI/JVMTI HotSwap advice weaving.
Parameters: cl - Class objects that should get redefined Parameters: definition - class definition,the definition is in the same form like in a class file. exception: UnmodifiableClassException - cl is a not modifiableclass (for example an interface or a class that's not in the class path). exception: IlligalClassFormatException - definition is a invalideclass definition exception: RuntimeException - could not apply operation. exception: NullPointerException - if cl is null . exception: IlligalArgumentExceptin - definition is null . |
redefineClasses | public static void redefineClasses(Class[] cls, byte[][] definitions)(Code) | | Redefines existing classes, actually only method bodies may be redefined,
but the JVMDI and JVMTI functions requieres the whole class code. The parameters
are two arrays of the same size, each entry of one array corresponds to the
entry with the same index in the other array.
The class that should be redefined must exist in the JVM (they must be loaded
in advance).
Required for JVMDI/JVMTI HotSwap advice weaving.
Parameters: cls - Array of Class objects that should get redefined Parameters: definitions - Array of class definitions, which are arrays of bytes,the definition is in the same form like in a class file. exception: UnmodifiableClassException - cls contains a not modifiableclass (for example an interface or a class that's not in the class path). exception: IlligalClassFormatException - definitions contains a invalideclass definition exception: RuntimeException - could not apply operation. exception: NullPointerException - if cls is null . exception: IlligalArgumentExceptin - definitions is null . |
resetAll | public static void resetAll()(Code) | | Resets all woven classes.
|
|
|