From a5ce1b53bf9304c08bb51639b48bb77085cd62b3 Mon Sep 17 00:00:00 2001
From: davidely <davidely@localhost>
Date: Sun, 02 Sep 2007 04:00:42 +0000
Subject: [PATCH] There are several improvements to the unit test framework in this commit.

---
 opends/src/server/org/opends/server/protocols/internal/InternalClientConnection.java |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/opends/src/server/org/opends/server/protocols/internal/InternalClientConnection.java b/opends/src/server/org/opends/server/protocols/internal/InternalClientConnection.java
index d90aaca..14aaebb 100644
--- a/opends/src/server/org/opends/server/protocols/internal/InternalClientConnection.java
+++ b/opends/src/server/org/opends/server/protocols/internal/InternalClientConnection.java
@@ -149,7 +149,6 @@
     nextMessageID    = new AtomicInteger(1);
     nextConnectionID = new AtomicLong(-1);
     nextOperationID  = new AtomicLong(0);
-    rootConnection   = new InternalClientConnection();
   }
 
 
@@ -380,6 +379,11 @@
    */
   public static InternalClientConnection getRootConnection()
   {
+    if (rootConnection == null)
+    {
+      rootConnection = new InternalClientConnection();
+    }
+
     return rootConnection;
   }
 
@@ -2219,5 +2223,15 @@
 
     buffer.append("\")");
   }
+
+  /**
+   * Called near the end of server shutdown.  This ensures that a new
+   * InternalClientConnection is created if the server is immediately
+   * restarted as part of an in-core restart.
+   */
+  static void clearRootClientConnectionAtShutdown()
+  {
+    rootConnection = null;
+  }
 }
 

--
Gitblit v1.10.0