Reputation: 7317
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
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