public class JmxRmiAgent
extends java.lang.Object
This implementation DOES NOT support port-forwarding however. The same hostname used internally
(specified in RMI_HOSTNAME_PROPERTY
or autodetected by java) must also be addressable
by the JMX client. This is due to how the property is used internally by java during the
RMI registry re-direction.
If you require that the client connects to a different hostname/IP than the one where the service is bound, consider using the Brooklyn JmxmpAgent, as this will not work!
This listens on "brooklyn.jmx-agent.rmi-port" unless overridden by system property
RMI_REGISTRY_PORT_PROPERTY
("brooklyn.jmx-agent.rmi-port").
brooklyn.util.jmx.jmxmp.JmxmpAgent
,
https://blogs.oracle.com/jmxetc/entry/connecting_through_firewall_using_jmx
,
https://blogs.oracle.com/jmxetc/entry/more_on_premain_and_jmx
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JMX_SERVER_ADDRESS_WILDCARD_PROPERTY
Whether JMX should bind to all interfaces.
|
static java.lang.String |
JMX_SERVER_DEFAULT_PORT |
static java.lang.String |
JMX_SERVER_PORT_PROPERTY
Port for JMX server (sometimes called JMX_RMI server) to listen on.
|
static java.lang.String |
RMI_HOSTNAME_PROPERTY
Hostname to advertise, and if "jmx.remote.server.address.wildcard" is false also the hostname/interface to bind to.
|
static java.lang.String |
RMI_REGISTRY_DEFAULT_PORT |
static java.lang.String |
RMI_REGISTRY_PORT_PROPERTY
Port for RMI registry to listen on.
|
Constructor and Description |
---|
JmxRmiAgent() |
Modifier and Type | Method and Description |
---|---|
static void |
agentmain(java.lang.String agentArgs) |
static void |
doMain(java.lang.String agentArgs) |
static void |
doMainForeground(java.lang.String agentArgs) |
static void |
main(java.lang.String[] args)
Convenience main method.
|
static void |
premain(java.lang.String agentArgs)
The entry point, uses the JDK dynamic agent loading feature.
|
javax.management.remote.JMXConnectorServer |
startServer(java.util.Properties properties) |
public static final java.lang.String RMI_REGISTRY_PORT_PROPERTY
RMI_REGISTRY_DEFAULT_PORT
.public static final java.lang.String RMI_REGISTRY_DEFAULT_PORT
public static final java.lang.String JMX_SERVER_PORT_PROPERTY
JMX_SERVER_DEFAULT_PORT
.public static final java.lang.String JMX_SERVER_DEFAULT_PORT
public static final java.lang.String RMI_HOSTNAME_PROPERTY
public static final java.lang.String JMX_SERVER_ADDRESS_WILDCARD_PROPERTY
public static void premain(java.lang.String agentArgs)
public static void agentmain(java.lang.String agentArgs)
public static void doMain(java.lang.String agentArgs)
public static void doMainForeground(java.lang.String agentArgs)
public javax.management.remote.JMXConnectorServer startServer(java.util.Properties properties)
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception