From fa6e5bb0c17c4d59d8598979feb1a7701bc32679 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Tue, 12 Dec 2006 23:55:39 +0000
Subject: [PATCH] Publish a separate monitor entry for each connection handler, which includes the protocol, listen address/port, number of established connections, and information about each connection.

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

diff --git a/opends/src/server/org/opends/server/core/DirectoryServer.java b/opends/src/server/org/opends/server/core/DirectoryServer.java
index e4f69a6..1d60a8e 100644
--- a/opends/src/server/org/opends/server/core/DirectoryServer.java
+++ b/opends/src/server/org/opends/server/core/DirectoryServer.java
@@ -91,6 +91,7 @@
 import org.opends.server.loggers.StartupDebugLogger;
 import org.opends.server.loggers.StartupErrorLogger;
 import org.opends.server.monitors.BackendMonitor;
+import org.opends.server.monitors.ConnectionHandlerMonitor;
 import org.opends.server.schema.AttributeTypeSyntax;
 import org.opends.server.schema.BinarySyntax;
 import org.opends.server.schema.BooleanEqualityMatchingRule;
@@ -5340,6 +5341,7 @@
         String instanceName = toLowerCase(monitor.getMonitorInstanceName());
         deregisterMonitorProvider(instanceName);
         monitor.finalizeMonitorProvider();
+        backend.setBackendMonitor(null);
       }
     }
   }
@@ -6444,6 +6446,11 @@
     synchronized (directoryServer.connectionHandlers)
     {
       directoryServer.connectionHandlers.add(handler);
+
+      ConnectionHandlerMonitor monitor = new ConnectionHandlerMonitor(handler);
+      monitor.initializeMonitorProvider(null);
+      handler.setConnectionHandlerMonitor(monitor);
+      registerMonitorProvider(monitor);
     }
   }
 
@@ -6463,6 +6470,15 @@
     synchronized (directoryServer.connectionHandlers)
     {
       directoryServer.connectionHandlers.remove(handler);
+
+      ConnectionHandlerMonitor monitor = handler.getConnectionHandlerMonitor();
+      if (monitor != null)
+      {
+        String instanceName = toLowerCase(monitor.getMonitorInstanceName());
+        deregisterMonitorProvider(instanceName);
+        monitor.finalizeMonitorProvider();
+        handler.setConnectionHandlerMonitor(null);
+      }
     }
   }
 

--
Gitblit v1.10.0