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/protocols/jmx/JmxConnectionHandler.java |   71 +++++++++++++++++++++++++++++++++++
 1 files changed, 71 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/protocols/jmx/JmxConnectionHandler.java b/opends/src/server/org/opends/server/protocols/jmx/JmxConnectionHandler.java
index bbfe835..672c353 100644
--- a/opends/src/server/org/opends/server/protocols/jmx/JmxConnectionHandler.java
+++ b/opends/src/server/org/opends/server/protocols/jmx/JmxConnectionHandler.java
@@ -61,6 +61,7 @@
 import org.opends.server.types.DN;
 import org.opends.server.types.ErrorLogCategory;
 import org.opends.server.types.ErrorLogSeverity;
+import org.opends.server.types.HostPort;
 import org.opends.server.types.InitializationException;
 import org.opends.server.types.ResultCode;
 
@@ -170,6 +171,21 @@
     new LinkedList<ConfigAttribute>();
 
   /**
+   * The unique name for this connection handler.
+   */
+  protected String connectionHandlerName;
+
+  /**
+   * The protocol used to communicate with clients.
+   */
+  protected String protocol;
+
+  /**
+   * The set of listeners for this connection handler.
+   */
+  protected LinkedList<HostPort> listeners = new LinkedList<HostPort>();
+
+  /**
    * The list of active client connection.
    */
   protected LinkedList<ClientConnection> connectionList =
@@ -493,6 +509,19 @@
       String message = getMessage(msgID, String.valueOf(configEntryDN), "");
       throw new InitializationException(msgID, message);
     }
+
+    if (useSSL)
+    {
+      protocol = "JMX+SSL";
+    }
+    else
+    {
+      protocol = "JMX";
+    }
+
+    listeners.clear();
+    listeners.add(new HostPort("0.0.0.0", listenPort));
+    connectionHandlerName = "JMX Connection Handler "+ listenPort;
   }
 
   /**
@@ -518,6 +547,36 @@
   }
 
   /**
+   * {@inheritDoc}
+   */
+  public String getConnectionHandlerName()
+  {
+    assert debugEnter(CLASS_NAME, "getConnectionHandlerName");
+
+    return connectionHandlerName;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public String getProtocol()
+  {
+    assert debugEnter(CLASS_NAME, "getProtocol");
+
+    return protocol;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public Collection<HostPort> getListeners()
+  {
+    assert debugEnter(CLASS_NAME, "getListeners");
+
+    return listeners;
+  }
+
+  /**
    * Retrieves the set of active client connections that have been
    * established through this connection handler.
    *
@@ -842,6 +901,18 @@
       }
     }
 
+    if (useSSL)
+    {
+      protocol = "JMX+SSL";
+    }
+    else
+    {
+      protocol = "JMX";
+    }
+
+    listeners.clear();
+    listeners.add(new HostPort(listenPort));
+
     //
     // Start the new RMI Connector
     rmiConnector.initialize();

--
Gitblit v1.10.0