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/core/EntryCacheConfigManager.java |   70 ++++++++++++++++++++---------------
 1 files changed, 40 insertions(+), 30 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/EntryCacheConfigManager.java b/opends/src/server/org/opends/server/core/EntryCacheConfigManager.java
index 8c2c8eb..9350080 100644
--- a/opends/src/server/org/opends/server/core/EntryCacheConfigManager.java
+++ b/opends/src/server/org/opends/server/core/EntryCacheConfigManager.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Portions Copyright 2006 Sun Microsystems, Inc.
+ *      Portions Copyright 2006-2007 Sun Microsystems, Inc.
  */
 package org.opends.server.core;
 
@@ -46,7 +46,9 @@
 import org.opends.server.types.ResultCode;
 
 import static org.opends.server.config.ConfigConstants.*;
-import static org.opends.server.loggers.Debug.*;
+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 static org.opends.server.loggers.Error.*;
 import static org.opends.server.messages.ConfigMessages.*;
 import static org.opends.server.messages.MessageHandler.*;
@@ -62,11 +64,6 @@
 public class EntryCacheConfigManager
        implements ConfigChangeListener, ConfigAddListener, ConfigDeleteListener
 {
-  /**
-   * The fully-qualified name of this class for debugging purposes.
-   */
-  private static final String CLASS_NAME =
-       "org.opends.server.core.EntryCacheConfigManager";
 
 
 
@@ -75,7 +72,6 @@
    */
   public EntryCacheConfigManager()
   {
-    assert debugConstructor(CLASS_NAME);
 
     // No implementation is required.
   }
@@ -94,7 +90,6 @@
   public void initializeEntryCache()
          throws InitializationException
   {
-    assert debugEnter(CLASS_NAME, "initializeEntryCache");
 
 
     // First, install a default entry cache so that there will be one even if
@@ -107,7 +102,10 @@
     }
     catch (Exception e)
     {
-      assert debugException(CLASS_NAME, "initializeEntryCache", e);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, e);
+      }
 
       int msgID = MSGID_CONFIG_ENTRYCACHE_CANNOT_INSTALL_DEFAULT_CACHE;
       String message = getMessage(msgID, stackTraceToSingleLineString(e));
@@ -126,7 +124,10 @@
     }
     catch (Exception e)
     {
-      assert debugException(CLASS_NAME, "initializeEntryCache", e);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, e);
+      }
 
       logError(ErrorLogCategory.CONFIGURATION, ErrorLogSeverity.SEVERE_ERROR,
                MSGID_CONFIG_ENTRYCACHE_CANNOT_GET_CONFIG_ENTRY,
@@ -150,7 +151,10 @@
       }
       catch (Exception e)
       {
-        assert debugException(CLASS_NAME, "initializeEntryCache", e);
+        if (debugEnabled())
+        {
+          debugCought(DebugLogLevel.ERROR, e);
+        }
 
         logError(ErrorLogCategory.CONFIGURATION, ErrorLogSeverity.SEVERE_ERROR,
                  MSGID_CONFIG_ENTRYCACHE_CANNOT_REGISTER_ADD_LISTENER,
@@ -177,7 +181,10 @@
     }
     catch (Exception e)
     {
-      assert debugException(CLASS_NAME, "initializeEntryCache", e);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, e);
+      }
 
       logError(ErrorLogCategory.CONFIGURATION, ErrorLogSeverity.SEVERE_WARNING,
                MSGID_CONFIG_ENTRYCACHE_CANNOT_REGISTER_DELETE_LISTENER,
@@ -215,7 +222,10 @@
     }
     catch (Exception e)
     {
-      assert debugException(CLASS_NAME, "initializeEntryCache", e);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, e);
+      }
 
       logError(ErrorLogCategory.CONFIGURATION, ErrorLogSeverity.SEVERE_ERROR,
                MSGID_CONFIG_ENTRYCACHE_UNABLE_TO_DETERMINE_ENABLED_STATE,
@@ -247,7 +257,10 @@
     }
     catch (Exception e)
     {
-      assert debugException(CLASS_NAME, "initializeEntryCache", e);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, e);
+      }
 
       logError(ErrorLogCategory.CONFIGURATION, ErrorLogSeverity.SEVERE_ERROR,
                MSGID_CONFIG_ENTRYCACHE_CANNOT_DETERMINE_CLASS,
@@ -265,7 +278,10 @@
     }
     catch (Exception e)
     {
-      assert debugException(CLASS_NAME, "initializeEntryCache", e);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, e);
+      }
 
       logError(ErrorLogCategory.CONFIGURATION, ErrorLogSeverity.SEVERE_ERROR,
                MSGID_CONFIG_ENTRYCACHE_CANNOT_LOAD_CLASS,
@@ -280,7 +296,10 @@
     }
     catch (Exception e)
     {
-      assert debugException(CLASS_NAME, "initializeEntryCache", e);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, e);
+      }
 
       logError(ErrorLogCategory.CONFIGURATION, ErrorLogSeverity.SEVERE_ERROR,
                MSGID_CONFIG_ENTRYCACHE_CANNOT_INSTANTIATE_CLASS,
@@ -296,7 +315,10 @@
     }
     catch (Exception e)
     {
-      assert debugException(CLASS_NAME, "initializeEntryCache", e);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, e);
+      }
 
       logError(ErrorLogCategory.CONFIGURATION, ErrorLogSeverity.SEVERE_ERROR,
                MSGID_CONFIG_ENTRYCACHE_CANNOT_INITIALIZE_CACHE,
@@ -329,8 +351,6 @@
   public boolean configChangeIsAcceptable(ConfigEntry configEntry,
                                           StringBuilder unacceptableReason)
   {
-    assert debugEnter(CLASS_NAME, "configChangeIsAcceptable",
-                      String.valueOf(configEntry), "java.lang.StringBuilder");
 
 
     // NYI
@@ -356,8 +376,6 @@
    */
   public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry)
   {
-    assert debugEnter(CLASS_NAME, "applyConfigurationChange",
-                      String.valueOf(configEntry));
 
     ResultCode        resultCode          = ResultCode.SUCCESS;
     boolean           adminActionRequired = false;
@@ -388,8 +406,6 @@
   public boolean configAddIsAcceptable(ConfigEntry configEntry,
                                        StringBuilder unacceptableReason)
   {
-    assert debugEnter(CLASS_NAME, "configAddIsAcceptable",
-                      String.valueOf(configEntry), "java.lang.StringBuilder");
 
 
     // NYI
@@ -414,8 +430,6 @@
    */
   public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry)
   {
-    assert debugEnter(CLASS_NAME, "applyConfigurationAdd",
-                      String.valueOf(configEntry));
 
     ResultCode        resultCode          = ResultCode.SUCCESS;
     boolean           adminActionRequired = false;
@@ -446,8 +460,6 @@
   public boolean configDeleteIsAcceptable(ConfigEntry configEntry,
                                           StringBuilder unacceptableReason)
   {
-    assert debugEnter(CLASS_NAME, "configDeleteIsAcceptable",
-                      String.valueOf(configEntry), "java.lang.StringBuilder");
 
 
     // NYI
@@ -471,8 +483,6 @@
    */
   public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry)
   {
-    assert debugEnter(CLASS_NAME, "applyConfigurationDelete",
-                      String.valueOf(configEntry));
 
     ResultCode        resultCode          = ResultCode.SUCCESS;
     boolean           adminActionRequired = false;

--
Gitblit v1.10.0