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

neil_a_wilson
01.34.2006 dc0b97516ea3c05cd6cc988a9120faecb0de675c
Fix a bug in which it was possible to dynamically disable a connection
handler but it could not be re-enabled. The reason for this is that when the
connection handler was re-enabled the associated thread was not started.

OpenDS Issue Number: 547
3 files modified
41 ■■■■■ changed files
opends/src/server/org/opends/server/core/ConnectionHandlerConfigManager.java 2 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java 7 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/ldap/LDAPRequestHandler.java 32 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/core/ConnectionHandlerConfigManager.java
@@ -688,6 +688,7 @@
      try
      {
        connectionHandler.initializeConnectionHandler(configEntry);
        connectionHandler.start();
      }
      catch (Exception e)
      {
@@ -703,6 +704,7 @@
      }
      connectionHandlers.put(connectionHandlerDN, connectionHandler);
      DirectoryServer.registerConnectionHandler(connectionHandler);
    }
opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
@@ -1107,6 +1107,13 @@
        requestHandler.processServerShutdown(finalizeReason);
      }
    }
    else
    {
      for (LDAPRequestHandler requestHandler : requestHandlers)
      {
        requestHandler.registerShutdownListener();
      }
    }
  }
opends/src/server/org/opends/server/protocols/ldap/LDAPRequestHandler.java
@@ -39,6 +39,8 @@
import org.opends.server.api.ConnectionSecurityProvider;
import org.opends.server.api.DirectoryThread;
import org.opends.server.api.ServerShutdownListener;
import org.opends.server.core.DirectoryServer;
import org.opends.server.core.InitializationException;
import static org.opends.server.loggers.Debug.*;
@@ -61,6 +63,7 @@
 */
public class LDAPRequestHandler
       extends DirectoryThread
       implements ServerShutdownListener
{
  /**
   * The fully-qualified name of this class for debugging purposes.
@@ -423,6 +426,35 @@
  /**
   * Retrieves the human-readable name for this shutdown listener.
   *
   * @return  The human-readable name for this shutdown listener.
   */
  public String getShutdownListenerName()
  {
    assert debugEnter(CLASS_NAME, "getShutdownListenerName");
    return handlerName;
  }
  /**
   * Causes this request handler to register itself as a shutdown listener with
   * the Directory Server.  This must be called if the connection handler is
   * shut down without closing all associated connections, otherwise the thread
   * would not be stopped by the server.
   */
  public void registerShutdownListener()
  {
    assert debugEnter(CLASS_NAME, "registerShutdownListener");
    DirectoryServer.registerShutdownListener(this);
  }
  /**
   * Indicates that the Directory Server has received a request to stop running
   * and that this shutdown listener should take any action necessary to prepare
   * for it.