From d74313cd4989848ab8cb3106a22cc1c8378cde58 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Tue, 04 Jun 2013 20:06:59 +0000
Subject: [PATCH] Fix unit test regression introduced in previous fix for OPENDJ-866 (Local RS is named differently).

---
 opends/src/server/org/opends/server/replication/service/ReplicationDomain.java |   39 +++++++++++++--------------------------
 1 files changed, 13 insertions(+), 26 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/service/ReplicationDomain.java b/opends/src/server/org/opends/server/replication/service/ReplicationDomain.java
index c4d4f1b..4dc31ec 100644
--- a/opends/src/server/org/opends/server/replication/service/ReplicationDomain.java
+++ b/opends/src/server/org/opends/server/replication/service/ReplicationDomain.java
@@ -49,7 +49,6 @@
 import org.opends.server.api.DirectoryThread;
 import org.opends.server.backends.task.Task;
 import org.opends.server.config.ConfigException;
-import org.opends.server.core.DirectoryServer;
 import org.opends.server.loggers.debug.DebugTracer;
 import org.opends.server.replication.common.AssuredMode;
 import org.opends.server.replication.common.ChangeNumber;
@@ -189,11 +188,6 @@
   private static Map<String, ReplicationDomain> domains =
     new HashMap<String, ReplicationDomain>();
 
-  /**
-   * The Monitor in charge of replication monitoring.
-   */
-  private ReplicationMonitor monitor;
-
   /*
    * Assured mode properties
    */
@@ -1480,11 +1474,9 @@
       }
 
       if (debugEnabled())
-        TRACER.debugInfo(
-           "[IE] In " + this.monitor.getMonitorInstanceName()
-           + " export ends with "
-           + " connected=" + broker.isConnected()
-           + " exportRootException=" + exportRootException);
+        TRACER.debugInfo("[IE] In " + getReplicationMonitorInstanceName()
+            + " export ends with " + " connected=" + broker.isConnected()
+            + " exportRootException=" + exportRootException);
 
       if (exportRootException != null)
       {
@@ -1591,6 +1583,11 @@
 
   }
 
+  private String getReplicationMonitorInstanceName()
+  {
+    return broker.getReplicationMonitor().getMonitorInstanceName();
+  }
+
   /*
    * For all remote servers in tht start list,
    * - wait it has finished the import and present the expected generationID
@@ -1839,9 +1836,8 @@
         msg = broker.receive(false, false, true);
 
         if (debugEnabled())
-          TRACER.debugInfo(
-              "[IE] In " + this.monitor.getMonitorInstanceName() +
-            ", receiveEntryBytes " + msg);
+          TRACER.debugInfo("[IE] In " + getReplicationMonitorInstanceName()
+              + ", receiveEntryBytes " + msg);
 
         if (msg == null)
         {
@@ -1892,9 +1888,9 @@
                   ieContext.msgCnt);
               broker.publish(amsg, false);
               if (debugEnabled())
-                TRACER.debugInfo(
-                    "[IE] In " + this.monitor.getMonitorInstanceName() +
-                    ", publish InitializeRcvAckMsg" + amsg);
+                TRACER.debugInfo("[IE] In "
+                    + getReplicationMonitorInstanceName()
+                    + ", publish InitializeRcvAckMsg" + amsg);
             }
           }
           return entryBytes;
@@ -3006,15 +3002,7 @@
             changetimeHeartbeatInterval);
 
         broker.start(replicationServers);
-
-        /*
-         * Create a replication monitor object responsible for publishing
-         * monitoring information below cn=monitor.
-         */
-        monitor = new ReplicationMonitor(this);
       }
-
-      DirectoryServer.registerMonitorProvider(monitor);
     }
   }
 
@@ -3101,7 +3089,6 @@
    */
   public void stopDomain()
   {
-    DirectoryServer.deregisterMonitorProvider(monitor);
     disableService();
     domains.remove(serviceID);
   }

--
Gitblit v1.10.0