billc.cn
billc.cn

Reputation: 7317

Use RMI to connect to JMX in local mode (without a port)

The JMX agent docs explains there's a local mode when com.sun.management.jmxremote.port is not supplied.

The doc also seems to imply this requires temporary files and is only understood by JConsole.

I am wondering is above correct and if so how to connect to the agent using RMI?

Upvotes: 0

Views: 440

Answers (1)

Nicholas
Nicholas

Reputation: 16056

It's called the Attach API. Technically, it does use a port, but it does not require the target JVM to have pre-launched a JMX Connector Server. Once connected, the target JVM will launch a new connector server and the JMXServiceURL of that server can be retrieved from the VirtualMachine instance by looking up the agent property com.sun.management.jmxremote.localConnectorAddress.

Upvotes: 3

Related Questions