As far as I understand the Attach API introduced in Java 6 allows inter-process modification of classes running in a target JVM by means of agents. My questions are:
ClassFileTransformer
. However if a retransformed method has active stack frames, those active frames continue to run the bytecodes of the original method. The retransformed method will be used on new invokes.The javadoc for the Instrumentation interface contains most of the information you are asking about.