JVMTI代理与单独的JVM之间的通信 [英] Communication between JVMTI agent and separate JVM

查看:77
本文介绍了JVMTI代理与单独的JVM之间的通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我很抱歉,这已经在这里得到了一定的回答,但是我认为我的情况有所不同.

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

如何与附加的jvmti代理进行通信在运行的JVM上

我的主要问题是... 我想知道是否仍然使用JNI或其他库在JVMTI Native Agent和完全独立的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.

这是一个小插图

那么这里发生了什么. 左侧的JVM装有本机代理.仅出于讨论目的,让我们假设我无权访问此Java应用程序的源代码.因此,我改为使用Java Native Agent从对象中获取信息.

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.

现在,我想将信息传输到右侧的JVM.由断开的链接表示.理想情况下,我想在JVM2上调用方法,让Native Agent从JVM1加载信息,然后将其返回给JVM2.

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.

我敢肯定我可以使用套接字来做到这一点,但是我只是想知道我是否在这里还有其他选择,例如使用JNI和注册本机代理或上一个答案中提到的内容.

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.

推荐答案

因此,由于没有人回答,因此我将在此处发布我将使用套接字的信息.

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

这是我使用的示例.

在Boost ASIO之间通过TCP发送两倍服务器和Java客户端

这篇关于JVMTI代理与单独的JVM之间的通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆