I am new to the JVMTI world and I seem to be missing something. The examples provided with the JDK are commandline driven with postmortem analysis. My project needs to interact with the agent from the gui but I am not sure how.
My java tool is launching a target virtual machine using the JDI LaunchingConnector. This target vm is launched with a JVMTI agent. The state of the agent needs to change while the target is running (changes are based on the user's input). What is the best way for the java tool to communicate directly with the TI agent running in the target vm?
My first thought was to set up a socket connection between the agent and the tool but is that risky? Is there a better or preferred way?
Any help or pointers to examples would be greatly appreciated. I want to make sure I am heading in the right direction.
The original post isn't very clear. It sounds like you are using JDI to launch the target VM, in which case the JDI implementation will manage the connection to the target VM. You also say the target VM is launching a JVM TI agent. In that case, you will need to code the transport yourself.