Class DefaultJmxConnector
- java.lang.Object
-
- org.opennms.netmgt.jmx.impl.connection.connectors.DefaultJmxConnector
-
- All Implemented Interfaces:
JmxServerConnector
public class DefaultJmxConnector extends java.lang.Object implements JmxServerConnector
Implements the default "jsr160" connection logic. If attempting to connect to a localhost address on the default OpenNMS JMX port, it will also bypass using a socket connection and connect directly to the JVM's MBeanServer.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opennms.netmgt.jmx.connection.JmxServerConnector
JmxServerConnector.Parameters
-
-
Field Summary
-
Fields inherited from interface org.opennms.netmgt.jmx.connection.JmxServerConnector
DEFAULT_OPENNMS_JMX_PORT, JMX_PORT_SYSTEM_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description DefaultJmxConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JmxServerConnectionWrapper
createConnection(java.net.InetAddress ipAddress, java.util.Map<java.lang.String,java.lang.String> propertiesMap)
Establishes a JMX connection (MBeanServerConnection
) to the givenipAddress
using required properties from the givenpropertiesMap
.JmxServerConnectionWrapper
createConnection(JmxConnectionConfig config)
-
-
-
Method Detail
-
createConnection
public JmxServerConnectionWrapper createConnection(java.net.InetAddress ipAddress, java.util.Map<java.lang.String,java.lang.String> propertiesMap) throws JmxServerConnectionException
Description copied from interface:JmxServerConnector
Establishes a JMX connection (
The createdMBeanServerConnection
) to the givenipAddress
using required properties from the givenpropertiesMap
.MBeanServerConnection
is wrapped by theJmxServerConnectionWrapper
.- Specified by:
createConnection
in interfaceJmxServerConnector
- Parameters:
ipAddress
- The IP address to connect to.propertiesMap
- Properties to use to establish the connection (e.g. timeout, user, password, etc.)- Returns:
- The wrapped
MBeanServerConnection
. May return null, but should throw aJmxServerConnectionException
instead. - Throws:
JmxServerConnectionException
- If a JMX connection to the givenipAddress
could not be established.
-
createConnection
public JmxServerConnectionWrapper createConnection(JmxConnectionConfig config) throws JmxServerConnectionException
- Throws:
JmxServerConnectionException
-
-