Class DefaultConnectionManager
- java.lang.Object
-
- org.opennms.netmgt.jmx.impl.connection.connectors.DefaultConnectionManager
-
- All Implemented Interfaces:
JmxConnectionManager
public class DefaultConnectionManager extends java.lang.Object implements JmxConnectionManager
Handles the establishing of a connection to the jmx server. Also implements a retry mechanism.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opennms.netmgt.jmx.connection.JmxConnectionManager
JmxConnectionManager.RetryCallback
-
-
Constructor Summary
Constructors Constructor Description DefaultConnectionManager()
Same asDefaultConnectionManager(int)
with aretryCount = 3
.DefaultConnectionManager(int retryCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JmxServerConnectionWrapper
connect(JmxConnectors connectorName, java.net.InetAddress ipAddress, java.util.Map<java.lang.String,java.lang.String> properties, JmxConnectionManager.RetryCallback retryCallback)
JmxServerConnector
getConnector(JmxConnectors connectorName)
Access-Method for theconnectorMap
.
-
-
-
Constructor Detail
-
DefaultConnectionManager
public DefaultConnectionManager(int retryCount)
- Parameters:
retryCount
- Any value >= 1. If <= 0, 3 is used.
-
DefaultConnectionManager
public DefaultConnectionManager()
Same asDefaultConnectionManager(int)
with aretryCount = 3
.
-
-
Method Detail
-
connect
public JmxServerConnectionWrapper connect(JmxConnectors connectorName, java.net.InetAddress ipAddress, java.util.Map<java.lang.String,java.lang.String> properties, JmxConnectionManager.RetryCallback retryCallback) throws JmxServerConnectionException
Description copied from interface:JmxConnectionManager
Connects to the givenipAddress
using theJmxServerConnector
registered withconnectionString
. If the connection to the server could not be established (e.g. no retries left) a JmxServerConnectionException is thrown.- Specified by:
connect
in interfaceJmxConnectionManager
- Parameters:
connectorName
- TheJmxConnectors
name of the connection. May be null.ipAddress
- the address to connect toproperties
- properties for the connection (e.g. port, user, etc.)retryCallback
- A callback, which should be called BEFORE creating the connection. May be null.- Returns:
- A JmxServerConnectionWrapper for the MBeanServerConnection.
- Throws:
JmxServerConnectionException
- if the connection to the given ipAddress using the registered JmxServerConnector could not be established.
-
getConnector
public JmxServerConnector getConnector(JmxConnectors connectorName) throws JmxServerConnectionException
Access-Method for theconnectorMap
.- Parameters:
connectorName
-- Returns:
- Throws:
JmxServerConnectionException
-
-