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:

  1. is strategy limited instrumentation of classes have not been loaded yet target jvm ? ,
  2. which limits of these transformations ?. example, body of existing methods can modified ?, or in class definition changed ?

  1. 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.
  2. 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

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -