mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Valery Kharseko
yesterday 9af5bd326500773d89ce30311af5e3cac2a9b3f5
opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/JmxConnectionHandler.java
@@ -13,6 +13,7 @@
 *
 * Copyright 2006-2009 Sun Microsystems, Inc.
 * Portions Copyright 2013-2016 ForgeRock AS.
 * Portions Copyright 2026 3A Systems, LLC.
 */
package org.opends.server.protocols.jmx;
@@ -88,6 +89,14 @@
  private final List<HostPort> listeners = new LinkedList<>();
  /**
   * The address the RMI registry and the RMI connector listen on. A change of
   * listen-address takes effect when the handler restarts, as its
   * configuration says: the registry, the connector and the listeners stay
   * on the same address until then.
   */
  private InetAddress listenAddress;
  /**
   * Creates a new instance of this JMX connection handler. It must be
   * initialized before it may be used.
   */
@@ -136,7 +145,7 @@
      }
      listeners.clear();
      listeners.add(HostPort.allAddresses(config.getListenPort()));
      listeners.add(new HostPort(listenAddress.getHostAddress(), config.getListenPort()));
      rmiConnector.finalizeConnectionHandler(portChanged);
      try
@@ -224,13 +233,14 @@
  /**
   * Get the JMX connection handler's listen address.
   * Get the JMX connection handler's listen address: the one it was
   * initialized with, until it restarts.
   *
   * @return Returns the JMX connection handler's listen address.
   */
  public InetAddress getListenAddress()
  {
    return currentConfig.getListenAddress();
    return listenAddress;
  }
  /**
@@ -301,8 +311,9 @@
      protocol = "JMX";
    }
    listenAddress = config.getListenAddress();
    listeners.clear();
    listeners.add(HostPort.allAddresses(config.getListenPort()));
    listeners.add(new HostPort(listenAddress.getHostAddress(), config.getListenPort()));
    connectionHandlerName = "JMX Connection Handler " + config.getListenPort();
    // Create a system property to store the JMX port the server is