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

Jean-Noel Rouvignac
14.37.2013 6a0f5da8fca5807b1e0d4e36091ae1f694ec098e
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
@@ -27,8 +27,6 @@
 */
package org.opends.server.protocols.ldap;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.loggers.ErrorLogger.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
@@ -69,8 +67,6 @@
import org.opends.server.util.SelectableCertificateKeyManager;
import org.opends.server.util.StaticUtils;
/**
 * This class defines a connection handler that will be used for communicating
 * with clients over LDAP. It is actually implemented in two parts: as a
@@ -734,7 +730,8 @@
    backlog = config.getAcceptBacklog();
    listenAddresses = config.getListenAddress();
    listenPort = config.getListenPort();
    numRequestHandlers = getNumRequestHandlers(config);
    numRequestHandlers =
        getNumRequestHandlers(config.getNumRequestHandlers(), friendlyName);
    // Construct a unique name for this connection handler, and put
    // together the set of listeners.
@@ -1543,27 +1540,4 @@
    }
  }
  // Determine the number of request handlers.
  private int getNumRequestHandlers(LDAPConnectionHandlerCfg configuration)
  {
    if (configuration.getNumRequestHandlers() == null)
    {
      // Automatically choose based on the number of processors.
      int cpus = Runtime.getRuntime().availableProcessors();
      int value = Math.max(2, cpus / 2);
      Message message = INFO_ERGONOMIC_SIZING_OF_REQUEST_HANDLER_THREADS.get(
          friendlyName, value);
      logError(message);
      return value;
    }
    else
    {
      return configuration.getNumRequestHandlers();
    }
  }
}