jvm - Limits and scope of the Java Attach API -
as far understand attach api introduced in java 6 allows inter-process modification of classes running in target jvm means of agents. questions are:
- is strategy limited instrumentation of classes have not been loaded yet target jvm ? ,
- which limits of these transformations ?. example, body of existing methods can modified ?, or in class definition changed ?
- you can instrument both classes loaded or loaded intercepting them
classfiletransformer
. if retransformed method has active stack frames, active frames continue run bytecodes of original method. retransformed method used on new invokes. - the redefinition/retransformation may change method bodies, constant pool , attributes. redefinition/retransformation must not add, remove or rename fields or methods, change signatures of methods, or change inheritance. these restrictions maybe lifted in future versions. class file bytes not checked, verified , installed until after transformations have been applied, if resultant bytes in error method throw exception.
the javadoc instrumentation interface contains of information asking about.
Comments
Post a Comment