Class JmxConnection

All Implemented Interfaces:
AdaptrisComponent, AdaptrisConnection, ComponentLifecycle, ComponentLifecycleExtension, StateManagedComponent

@ComponentProfile(summary="Connect to a JMX MBeanServer instance", tag="connections,jmx") public class JmxConnection extends AllowsRetriesConnection
  • Constructor Details

    • JmxConnection

      public JmxConnection()
  • Method Details

    • prepareConnection

      protected void prepareConnection() throws CoreException
      Specified by:
      prepareConnection in class AdaptrisConnectionImp
      Throws:
      CoreException
    • initConnection

      protected void initConnection() throws CoreException
      Description copied from class: AdaptrisConnectionImp
      Initialise the underlying connection.
      Specified by:
      initConnection in class AdaptrisConnectionImp
      Throws:
      CoreException - wrapping any exception.
    • startConnection

      protected void startConnection() throws CoreException
      Description copied from class: AdaptrisConnectionImp
      Start the underlying connection.
      Specified by:
      startConnection in class AdaptrisConnectionImp
      Throws:
      CoreException - wrapping any exception.
    • stopConnection

      protected void stopConnection()
      Description copied from class: AdaptrisConnectionImp
      Stop the underlying connection.
      Specified by:
      stopConnection in class AdaptrisConnectionImp
    • closeConnection

      protected void closeConnection()
      Description copied from class: AdaptrisConnectionImp
      Close the underlying connection.
      Specified by:
      closeConnection in class AdaptrisConnectionImp
    • mbeanServerConnection

      public MBeanServerConnection mbeanServerConnection() throws CoreException
      Throws:
      CoreException
    • getJmxServiceUrl

      public String getJmxServiceUrl()
      Returns:
      the jmxServiceUrl
    • setJmxServiceUrl

      public void setJmxServiceUrl(String s)
      Set the JMX ServiceURL.
      Parameters:
      s - the jmxServiceUrl to set; if not specified, then a local JMX connector is assumed.
    • getJmxProperties

      public KeyValuePairSet getJmxProperties()
      Returns:
      the jmxProperties
    • setJmxProperties

      public void setJmxProperties(KeyValuePairSet s)
      Parameters:
      s - the additional jmx properties to set
    • getUsername

      public String getUsername()
      Returns:
      the username
    • setUsername

      public void setUsername(String s)
      Set the username for accessing JMX.

      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.

      Parameters:
      s - the username to set
    • getPassword

      public String getPassword()
      Returns:
      the password
    • setPassword

      public void setPassword(String s)
      Set the password.

      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.

      Parameters:
      s - the password to set
    • getAdditionalDebug

      public Boolean getAdditionalDebug()
    • setAdditionalDebug

      public void setAdditionalDebug(Boolean b)
      Whether or not to generate additional TRACE level debug when attempting connections.
      Parameters:
      b - true to enable additional logging; default false.
    • additionalDebug

      protected boolean additionalDebug()
    • withJmxServiceUrl

      public JmxConnection withJmxServiceUrl(String s)
    • withUsername

      public JmxConnection withUsername(String s)
    • withPassword

      public JmxConnection withPassword(String s)
    • withJmxProperties

      public JmxConnection withJmxProperties(KeyValuePairSet kvps)
    • withAdditionalDebug

      public JmxConnection withAdditionalDebug(Boolean b)
    • withRetries

      public JmxConnection withRetries(Integer maxRetries, TimeInterval retryInterval)