假装是“jconsole”
我想避免为进程分配特定的 TCP 端口,但仍然能够与其中的 JMX MBean 建立(本地)连接。我不断看到证据表明这应该是可能的,但我无法弄清楚我将使用什么作为 JNDI 名称来引用某些此类进程,或者像 jconsole 那样迭代所有这些进程。
I'd like to avoid assigning specific TCP ports to processes, but still be able to make (local) connection to the JMX MBeans inside them. I keep seeing evidence that this should be possible, but I cannot work out what I'd use as a JNDI name to reference some such process, or to iterate over all of them as jconsole does.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信您正在寻找 Attach API< /a> 不会(表面上)使用 JNDI 名称,而只是通过 PID 连接。这不是一个坏方法,但我不确定是否所有 JVM 都实现了这个 API。这是 groovy 中的一个快速示例:
I believe you're looking for the Attach API which will not (outwardly) use a JNDI name and simply connects by PID. It's not a bad way to go, but I am not sure if all JVMs implement this API. Here's a quickie example in groovy: