@ComponentProfile(summary="Connect to a JMX MBeanServer instance", tag="connections,jmx") public class JmxConnection extends AllowsRetriesConnection
log
Constructor and Description |
---|
JmxConnection() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
additionalDebug() |
protected void |
closeConnection()
Close the underlying connection.
|
java.lang.Boolean |
getAdditionalDebug() |
KeyValuePairSet |
getJmxProperties() |
java.lang.String |
getJmxServiceUrl() |
java.lang.String |
getPassword() |
java.lang.String |
getUsername() |
protected void |
initConnection()
Initialise the underlying connection.
|
javax.management.MBeanServerConnection |
mbeanServerConnection() |
protected void |
prepareConnection() |
void |
setAdditionalDebug(java.lang.Boolean b)
Whether or not to generate additional TRACE level debug when attempting connections.
|
void |
setJmxProperties(KeyValuePairSet s) |
void |
setJmxServiceUrl(java.lang.String s)
Set the JMX ServiceURL.
|
void |
setPassword(java.lang.String s)
Set the password.
|
void |
setUsername(java.lang.String s)
Set the username for accessing JMX.
|
protected void |
startConnection()
Start the underlying connection.
|
protected void |
stopConnection()
Stop the underlying connection.
|
JmxConnection |
withAdditionalDebug(java.lang.Boolean b) |
JmxConnection |
withJmxProperties(KeyValuePairSet kvps) |
JmxConnection |
withJmxServiceUrl(java.lang.String s) |
JmxConnection |
withPassword(java.lang.String s) |
JmxConnection |
withRetries(java.lang.Integer maxRetries,
TimeInterval retryInterval) |
JmxConnection |
withUsername(java.lang.String s) |
connectionAttempts, connectionRetryInterval, createLoggingStatement, getConnectionAttempts, getConnectionRetryInterval, logWarning, setConnectionAttempts, setConnectionRetryInterval
addExceptionListener, addMessageConsumer, addMessageProducer, changeState, cloneForTesting, close, connectionErrorHandler, getConnectionErrorHandler, getLookupName, getUniqueId, getWorkersFirstOnShutdown, init, prepare, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, retrieveConnection, retrieveExceptionListeners, retrieveMessageConsumers, retrieveMessageProducers, setConnectionErrorHandler, setLookupName, setUniqueId, setWorkersFirstOnShutdown, start, stop, workersFirstOnShutdown
protected void prepareConnection() throws CoreException
prepareConnection
in class AdaptrisConnectionImp
CoreException
protected void initConnection() throws CoreException
AdaptrisConnectionImp
initConnection
in class AdaptrisConnectionImp
CoreException
- wrapping any exception.protected void startConnection() throws CoreException
AdaptrisConnectionImp
startConnection
in class AdaptrisConnectionImp
CoreException
- wrapping any exception.protected void stopConnection()
AdaptrisConnectionImp
stopConnection
in class AdaptrisConnectionImp
protected void closeConnection()
AdaptrisConnectionImp
closeConnection
in class AdaptrisConnectionImp
public javax.management.MBeanServerConnection mbeanServerConnection() throws CoreException
CoreException
public java.lang.String getJmxServiceUrl()
public void setJmxServiceUrl(java.lang.String s)
s
- the jmxServiceUrl to set; if not specified, then a local JMX connector is assumed.public KeyValuePairSet getJmxProperties()
public void setJmxProperties(KeyValuePairSet s)
s
- the additional jmx properties to setpublic java.lang.String getUsername()
public void setUsername(java.lang.String s)
If both the username / password are set, then a jmx.remote.profiles="SASL/PLAIN"
is added to the environment
if it doesn't already exist.
s
- the username to setpublic java.lang.String getPassword()
public void setPassword(java.lang.String s)
If both the username / password are set, then a jmx.remote.profiles="SASL/PLAIN"
is added to the environment
if it doesn't already exist.
s
- the password to setpublic java.lang.Boolean getAdditionalDebug()
public void setAdditionalDebug(java.lang.Boolean b)
b
- true to enable additional logging; default false.protected boolean additionalDebug()
public JmxConnection withJmxServiceUrl(java.lang.String s)
public JmxConnection withUsername(java.lang.String s)
public JmxConnection withPassword(java.lang.String s)
public JmxConnection withJmxProperties(KeyValuePairSet kvps)
public JmxConnection withAdditionalDebug(java.lang.Boolean b)
public JmxConnection withRetries(java.lang.Integer maxRetries, TimeInterval retryInterval)