Class ConnectorServer

All Implemented Interfaces:
LifeCycle

public class ConnectorServer extends AbstractLifeCycle

LifeCycle wrapper for JMXConnectorServer.

This class provides the following facilities:

  • participates in the Server lifecycle
  • starts the RMI registry if not there already
  • allows to bind the RMI registry and the RMI server to the loopback interface
  • makes it easy to use TLS for the RMI communication
  • Field Details

    • RMI_REGISTRY_CLIENT_SOCKET_FACTORY_ATTRIBUTE

      public static final String RMI_REGISTRY_CLIENT_SOCKET_FACTORY_ATTRIBUTE
      See Also:
  • Constructor Details

    • ConnectorServer

      public ConnectorServer(JMXServiceURL serviceURL, String objectName)
      Constructs a ConnectorServer
      Parameters:
      serviceURL - the address of the new ConnectorServer
      objectName - object name string to be assigned to ConnectorServer bean
    • ConnectorServer

      public ConnectorServer(JMXServiceURL serviceURL, Map<String,?> environment, String objectName)
      Constructs a ConnectorServer
      Parameters:
      serviceURL - the address of the new ConnectorServer
      environment - a set of attributes to control the new ConnectorServer's behavior. This parameter can be null. Keys in this map must be Strings. The appropriate type of each associated value depends on the attribute. The contents of environment are not changed by this call.
      objectName - object name string to be assigned to ConnectorServer bean
    • ConnectorServer

      public ConnectorServer(JMXServiceURL serviceURL, Map<String,?> environment, String objectName, SslContextFactory.Server sslContextFactory)
      Constructs a ConnectorServer
      Parameters:
      serviceURL - the address of the new ConnectorServer
      environment - a set of attributes to control the new ConnectorServer's behavior. This parameter can be null. Keys in this map must be Strings. The appropriate type of each associated value depends on the attribute. The contents of environment are not changed by this call.
      objectName - object name string to be assigned to ConnectorServer bean
      sslContextFactory - the SslContextFactory.Server to use for secure communication
  • Method Details

    • getAddress

      public JMXServiceURL getAddress()
      Get the JMXServiceURL of this ConnectorServer.
      Returns:
      the JMXServiceURL of this ConnectorServer
    • putAttribute

      public void putAttribute(String name, Object value)
      Puts an attribute into the environment Map.
      Parameters:
      name - the attribute name
      value - the attribute value
    • getObjectName

      public String getObjectName()
      Get the ObjectName of this ConnectorServer.
      Returns:
      the ObjectName of this ConnectorServer
    • setObjectName

      public void setObjectName(String objectName)
      Set the ObjectName of this ConnectorServer.
      Parameters:
      objectName - the ObjectName of this ConnectorServer
    • getSslContextFactory

      public SslContextFactory.Server getSslContextFactory()
    • setSslContextFactory

      public void setSslContextFactory(SslContextFactory.Server sslContextFactory)
    • doStart

      public void doStart() throws Exception
      Description copied from class: AbstractLifeCycle
      Method to override to start the lifecycle
      Overrides:
      doStart in class AbstractLifeCycle
      Throws:
      AbstractLifeCycle.StopException - If thrown, the lifecycle will immediately be stopped.
      Exception - If there was a problem starting. Will cause a transition to FAILED state
    • doStop

      public void doStop() throws Exception
      Description copied from class: AbstractLifeCycle
      Method to override to stop the lifecycle
      Overrides:
      doStop in class AbstractLifeCycle
      Throws:
      Exception - If there was a problem stopping. Will cause a transition to FAILED state