From 3e8e32d7139c5f70a67f04e4e1337e8ee0b3a04b Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Tue, 10 Feb 2009 18:38:49 +0000
Subject: [PATCH] Fix issue 3775: Intermittent unit test failure in NetworkGroupTest

---
 opends/src/server/org/opends/server/core/networkgroups/NetworkGroupConfigManager.java |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/networkgroups/NetworkGroupConfigManager.java b/opends/src/server/org/opends/server/core/networkgroups/NetworkGroupConfigManager.java
index 5608ad9..136e0da 100644
--- a/opends/src/server/org/opends/server/core/networkgroups/NetworkGroupConfigManager.java
+++ b/opends/src/server/org/opends/server/core/networkgroups/NetworkGroupConfigManager.java
@@ -219,6 +219,35 @@
 
 
   /**
+   * Finalizes all network groups currently defined in the Directory
+   * Server configuration. This should only be called at Directory
+   * Server shutdown.
+   */
+  public void finalizeNetworkGroups()
+  {
+    // Get the root configuration object.
+    ServerManagementContext managementContext =
+        ServerManagementContext.getInstance();
+    RootCfg rootConfiguration =
+        managementContext.getRootConfiguration();
+
+    // Remove add / delete listeners.
+    rootConfiguration.removeNetworkGroupAddListener(this);
+    rootConfiguration.removeNetworkGroupDeleteListener(this);
+
+    // Finalize the existing network groups.
+    for (NetworkGroup networkGroup : networkGroups.values())
+    {
+      networkGroup.finalizeNetworkGroup();
+    }
+
+    // Clean up remaining state so that it is possible to reinitialize.
+    networkGroups.clear();
+  }
+
+
+
+  /**
    * Initializes all network groups currently defined in the Directory
    * Server configuration. This should only be called at Directory
    * Server startup.

--
Gitblit v1.10.0