Ralph Emerson
Ralph Emerson

Reputation: 113

Communication between JVMTI agent and separate JVM

First off i apologize as this is somewhat answered already here, but I think my situation is a bit different.

How to communicate with jvmti agent attached on a running JVM

My main question is... I am wondering if there are anyways using the JNI or other libraries to communicate between a JVMTI Native Agent and a completely separate JVM.

Here is a small illustration

enter image description here

So whats happening here. The JVM on the left is loaded with a native agent. Just for discussion sake let's assume I have no access to the source code of this java application. So instead I use the Java Native Agent to garner information from the objects.

Now I want to transfer the information to the JVM on the right. Represented by the broken link. Ideally i'd like to call a method on JVM2, have the Native Agent load information from JVM1 and then return it to JVM2.

I'm pretty sure I can do this with sockets, but I was just wondering if I had any other options here such as using JNI and registering native agents or something like mentioned in the previous answer.

Upvotes: 1

Views: 546

Answers (1)

Ralph Emerson
Ralph Emerson

Reputation: 113

So since nobody replied, I'll just post here that I'm gonna use Sockets.

Here is an example I used.

sending doubles via TCP between Boost ASIO server and Java client

Upvotes: 1

Related Questions