From 86254aa91551fb5ab1e630a6667ad9aef61511ff Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Tue, 07 Jan 2014 13:02:59 +0000
Subject: [PATCH] OPENDJ-1269 - JMX connection counter not being decremented when connections are closed. CR-2792. Fix is to remove the Client connection from the connectionList when disconnecting. Changed the LinkedList to concurrent list (CopyOnWriteArrayList) Changes include code cleanup, removal of unused interface (AlertGenerator)

---
 opendj-sdk/opends/src/server/org/opends/server/protocols/jmx/JmxClientConnection.java |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/protocols/jmx/JmxClientConnection.java b/opendj-sdk/opends/src/server/org/opends/server/protocols/jmx/JmxClientConnection.java
index e35afd1..dc62882 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/protocols/jmx/JmxClientConnection.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/protocols/jmx/JmxClientConnection.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2006-2009 Sun Microsystems, Inc.
- *      Portions Copyright 2011-2013 ForgeRock AS
+ *      Portions Copyright 2011-2014 ForgeRock AS
  */
 package org.opends.server.protocols.jmx;
 
@@ -137,7 +137,6 @@
   {
     JMXConnectionNotification jcn ;
 
-    //
     // We don't have the expected notification
     if ( ! (notif instanceof JMXConnectionNotification))
     {
@@ -148,7 +147,6 @@
       jcn = (JMXConnectionNotification) notif ;
     }
 
-    //
     // The only handled notifications are CLOSED and FAILED
     if ((!jcn.getType().equals(JMXConnectionNotification.CLOSED))
         && (!jcn.getType().equals(JMXConnectionNotification.FAILED)))
@@ -156,14 +154,12 @@
       return;
     }
 
-    //
     // Check if the closed connection corresponds to the current connection
     if (!(jcn.getConnectionId().equals(jmxConnectionID)))
     {
       return;
     }
 
-    //
     // Ok, we can perform the unbind: call finalize
     disconnect(DisconnectReason.CLIENT_DISCONNECT, false, null);
   }
@@ -967,10 +963,9 @@
       return;
     }
     disconnectStarted = true ;
+    jmxConnectionHandler.unregisterClientConnection(this);
     finalizeConnectionInternal();
 
-
-
     // unbind the underlying connection
     try
     {

--
Gitblit v1.10.0