From 455897cc245b67d929f409a93cfa7106e835cc1f Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Thu, 01 Mar 2007 03:27:06 +0000
Subject: [PATCH] This removes old debug logging framework method calls that are going to be automatically instrumented by AspectJ. Non instrumented debug method calls are updated to use the new debug framework methods. However, the new debug logging framework is not yet active as the Aspects are not weaved in. After this revision, debug logging will be disabled in the server until the new AOP framework is complete. 

---
 opends/src/server/org/opends/server/protocols/jmx/DirectoryRMIClientSocketFactory.java |   44 +++++++++++++++++++-------------------------
 1 files changed, 19 insertions(+), 25 deletions(-)

diff --git a/opends/src/server/org/opends/server/protocols/jmx/DirectoryRMIClientSocketFactory.java b/opends/src/server/org/opends/server/protocols/jmx/DirectoryRMIClientSocketFactory.java
index fe0972b..688ffae 100644
--- a/opends/src/server/org/opends/server/protocols/jmx/DirectoryRMIClientSocketFactory.java
+++ b/opends/src/server/org/opends/server/protocols/jmx/DirectoryRMIClientSocketFactory.java
@@ -22,14 +22,14 @@
  * CDDL HEADER END
  *
  *
- *      Portions Copyright 2006 Sun Microsystems, Inc.
+ *      Portions Copyright 2006-2007 Sun Microsystems, Inc.
  */
 package org.opends.server.protocols.jmx;
 
-import static org.opends.server.loggers.Debug.debugConstructor;
-import static org.opends.server.loggers.Debug.debugEnter;
-import static org.opends.server.loggers.Debug.debugException;
-import static org.opends.server.loggers.Debug.debugMessage;
+import static org.opends.server.loggers.debug.DebugLogger.debugVerbose;
+import static org.opends.server.loggers.debug.DebugLogger.debugCought;
+import static org.opends.server.loggers.debug.DebugLogger.debugEnabled;
+import org.opends.server.types.DebugLogLevel;
 
 import java.io.IOException;
 
@@ -46,9 +46,6 @@
 import javax.net.ssl.SSLSocket;
 import javax.net.ssl.SSLSocketFactory;
 
-import org.opends.server.types.DebugLogCategory;
-import org.opends.server.types.DebugLogSeverity;
-
 /**
  * A <code>DirectoryRMIClientSocketFactory</code> instance is used by the
  * RMI runtime in order to obtain client sockets for RMI calls via SSL.
@@ -61,11 +58,6 @@
     RMIClientSocketFactory, Serializable
 {
 
-  /**
-   * The fully-qualified name of this class for debugging purposes.
-   */
-  private static final String CLASS_NAME =
-    "org.opends.server.protocols.jmx.DirectoryRMIClientSocketFactory";
 
   /**
    * The serial version identifier required to satisfy the compiler because
@@ -116,7 +108,6 @@
    */
   public DirectoryRMIClientSocketFactory(boolean wellknown)
   {
-    assert debugConstructor(CLASS_NAME);
     this.needClientCertificate = wellknown;
 
     // We don't force the initialization of the SSLSocketFactory
@@ -297,15 +288,12 @@
   private synchronized SSLSocketFactory getSSLSocketFactory()
       throws IOException
   {
-    assert debugEnter(CLASS_NAME, "getSSLSocketFactory");
     if (sslSocketFactory == null)
     {
-      assert debugMessage(
-          DebugLogCategory.CONNECTION_HANDLING,
-          DebugLogSeverity.VERBOSE,
-          CLASS_NAME,
-          "getSSLSocketFactory",
-          "sslSocketFactory is null, get a new one");
+      if (debugEnabled())
+      {
+        debugVerbose("sslSocketFactory is null, get a new one");
+      }
 
       // socket factory not yet initialized
       // initialize the trust
@@ -318,7 +306,7 @@
       // Env. If yes, use it for this SSL Connection
       if ((connectionEnv != null)
           && (connectionEnv
-              .containsKey(JmxConnectionHandler.TRUST_MANAGER_ARRAY_KEY)))
+          .containsKey(JmxConnectionHandler.TRUST_MANAGER_ARRAY_KEY)))
       {
         try
         {
@@ -327,7 +315,10 @@
         }
         catch (Exception e)
         {
-          assert debugException(CLASS_NAME, "getSSLSocketFactory", e);
+          if (debugEnabled())
+          {
+            debugCought(DebugLogLevel.ERROR, e);
+          }
           tms = null;
         }
 
@@ -340,7 +331,7 @@
               + JmxConnectionHandler.TRUST_MANAGER_ARRAY_KEY
               + "] in connection environment : "
               + connectionEnv
-                  .get(JmxConnectionHandler.TRUST_MANAGER_ARRAY_KEY));
+              .get(JmxConnectionHandler.TRUST_MANAGER_ARRAY_KEY));
         }
       }
 
@@ -354,7 +345,10 @@
       }
       catch (Exception e)
       {
-        assert debugException(CLASS_NAME, "getSSLSocketFactory", e);
+        if (debugEnabled())
+        {
+          debugCought(DebugLogLevel.ERROR, e);
+        }
         throw new IOException("Unable to initialize SSL context : "
             + e.getMessage());
       }

--
Gitblit v1.10.0