I recently had a task where I had to use hot code replace functionality. So I did it using the Java Instrumentation API available in tools.jar.
Does eclipse use some different logic for hot replace of new class files or uses same Java API ?
I tried to read from some places but was not clear:
Eclipse Java debugger transmits new class files over the debugging
channel to another JVM
This line in Eclipse Hot Code Replace was not clear.
I believe eclipse use the same logic, they are both relying on a native interface called JVMTI. The JVMTI provide tools to inspect the state, and to control the execution of applications running in the Java virtual machine.
There is a agent of JVMTI in the Java Instrumentation Implementation. The agent to talks to vm and perform certain tasks. it also has redefineClasses method.
Eclipse Java debugger or other tools use the JPDA (Java Platform Debugger Architecture), and the JPDA mainly have three parts (JVMTI,JDWP,JDI). JVMTI act as debuggee,JDI act as debugger,and the JDWP act as communication channel between them.
In the end, they all talk to JVMTI,and it use the same logic.