扩展客户端远程连接的JCONSOLE功能

时间:2022-02-19 04:19:45

I have a simple JMX application that has exposed MBeans based on this tutorial

我有一个简单的JMX应用程序,它基于本教程公开了mbean

Is it possible to launch this application with a custom class in the classpath that extends JCONSOLE, so that when a client tries to access it remotely the extended jconsole window opens?

是否可以在扩展JCONSOLE的类路径中使用自定义类来启动这个应用程序,以便当客户机试图远程访问它时,扩展的JCONSOLE窗口将打开?

So for example, I create a simple application and package it in MyApp.jar. Then I run it with the following commands in the cmd:

例如,我创建了一个简单的应用程序并将它打包到MyApp.jar中。然后在cmd中运行以下命令:

java -classpath JconsoleExtension.jar;MyApp.jar 
-com.sun.management.jmxremote.login.config=management.properties 
-Djava.security.auth.login.config=./sample_jaas.config 
com.test.running.RunningImplementation

With managepement.properties looking something like this:

managepement。像这样的属性:

com.sun.management.jmxremote=true
com.sun.management.jmxremote.port=1234
com.sun.management.jmxremote.login.config=Sample

Is it possible for a client to connect remotely using:

客户端是否可以通过以下方式进行远程连接:

jconsole hostname:1234

And pull up the jconsole window with the extended functionality?

用扩展的功能打开jconsole窗口?

Or, would the client have to reference the extension when trying to connect, so something like:

或者,客户在尝试连接时是否必须引用扩展名,比如:

 jconsole hostname:1234 -classpath JconsoleExtension.jar

1 个解决方案

#1


4  

It looks as if JConsole can't be extended on the server side. The extension needs to be called from the client side, and as such they'd need to have access to the .jar where it's extended.

看起来JConsole不能在服务器端扩展。扩展需要从客户端调用,因此他们需要访问扩展的.jar。

#1


4  

It looks as if JConsole can't be extended on the server side. The extension needs to be called from the client side, and as such they'd need to have access to the .jar where it's extended.

看起来JConsole不能在服务器端扩展。扩展需要从客户端调用,因此他们需要访问扩展的.jar。