From b0a7e3cf4a65ea95c79cf002596428d0aed2e26e Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Tue, 22 May 2007 23:30:15 +0000
Subject: [PATCH] Remove the dependence on AspectJ for all non method-entry and method-exit related debug messages. All debug statements will now work w/o  weaving enabled. However, method-entry and method-exit debug messages work only with weaving enabled.

---
 opends/src/server/org/opends/server/extensions/FileBasedKeyManagerProvider.java |   75 ++++++++++++++++++++-----------------
 1 files changed, 40 insertions(+), 35 deletions(-)

diff --git a/opends/src/server/org/opends/server/extensions/FileBasedKeyManagerProvider.java b/opends/src/server/org/opends/server/extensions/FileBasedKeyManagerProvider.java
index a613338..33bb93e 100644
--- a/opends/src/server/org/opends/server/extensions/FileBasedKeyManagerProvider.java
+++ b/opends/src/server/org/opends/server/extensions/FileBasedKeyManagerProvider.java
@@ -57,8 +57,8 @@
 import org.opends.server.types.ResultCode;
 
 import static org.opends.server.config.ConfigConstants.*;
-import static org.opends.server.loggers.debug.DebugLogger.debugCaught;
-import static org.opends.server.loggers.debug.DebugLogger.debugEnabled;
+import static org.opends.server.loggers.debug.DebugLogger.*;
+import org.opends.server.loggers.debug.DebugTracer;
 import org.opends.server.types.DebugLogLevel;
 import static org.opends.server.messages.ExtensionsMessages.*;
 import static org.opends.server.messages.MessageHandler.*;
@@ -74,6 +74,11 @@
        extends KeyManagerProvider<FileBasedKeyManagerCfg>
        implements ConfigurableComponent
 {
+  /**
+   * The tracer object for the debug logger.
+   */
+  private static final DebugTracer TRACER = getTracer();
+
 
 
 
@@ -164,7 +169,7 @@
     {
       if (debugEnabled())
       {
-        debugCaught(DebugLogLevel.ERROR, ce);
+        TRACER.debugCaught(DebugLogLevel.ERROR, ce);
       }
 
       throw ce;
@@ -173,7 +178,7 @@
     {
       if (debugEnabled())
       {
-        debugCaught(DebugLogLevel.ERROR, ie);
+        TRACER.debugCaught(DebugLogLevel.ERROR, ie);
       }
 
       throw ie;
@@ -182,7 +187,7 @@
     {
       if (debugEnabled())
       {
-        debugCaught(DebugLogLevel.ERROR, e);
+        TRACER.debugCaught(DebugLogLevel.ERROR, e);
       }
 
       msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_FILE;
@@ -216,7 +221,7 @@
         {
           if (debugEnabled())
           {
-            debugCaught(DebugLogLevel.ERROR, kse);
+            TRACER.debugCaught(DebugLogLevel.ERROR, kse);
           }
 
           msgID = MSGID_FILE_KEYMANAGER_INVALID_TYPE;
@@ -231,7 +236,7 @@
     {
       if (debugEnabled())
       {
-        debugCaught(DebugLogLevel.ERROR, ie);
+        TRACER.debugCaught(DebugLogLevel.ERROR, ie);
       }
 
       throw ie;
@@ -240,7 +245,7 @@
     {
       if (debugEnabled())
       {
-        debugCaught(DebugLogLevel.ERROR, e);
+        TRACER.debugCaught(DebugLogLevel.ERROR, e);
       }
 
       msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_TYPE;
@@ -296,7 +301,7 @@
       {
         if (debugEnabled())
         {
-          debugCaught(DebugLogLevel.ERROR, ie);
+          TRACER.debugCaught(DebugLogLevel.ERROR, ie);
         }
 
         throw ie;
@@ -305,7 +310,7 @@
       {
         if (debugEnabled())
         {
-          debugCaught(DebugLogLevel.ERROR, e);
+          TRACER.debugCaught(DebugLogLevel.ERROR, e);
         }
 
         msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_PIN_PROPERTY;
@@ -346,7 +351,7 @@
       {
         if (debugEnabled())
         {
-          debugCaught(DebugLogLevel.ERROR, ie);
+          TRACER.debugCaught(DebugLogLevel.ERROR, ie);
         }
 
         throw ie;
@@ -355,7 +360,7 @@
       {
         if (debugEnabled())
         {
-          debugCaught(DebugLogLevel.ERROR, e);
+          TRACER.debugCaught(DebugLogLevel.ERROR, e);
         }
 
         msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_PIN_ENVAR;
@@ -424,7 +429,7 @@
       {
         if (debugEnabled())
         {
-          debugCaught(DebugLogLevel.ERROR, ie);
+          TRACER.debugCaught(DebugLogLevel.ERROR, ie);
         }
 
         throw ie;
@@ -433,7 +438,7 @@
       {
         if (debugEnabled())
         {
-          debugCaught(DebugLogLevel.ERROR, e);
+          TRACER.debugCaught(DebugLogLevel.ERROR, e);
         }
 
         msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_PIN_FILE;
@@ -461,7 +466,7 @@
       {
         if (debugEnabled())
         {
-          debugCaught(DebugLogLevel.ERROR, e);
+          TRACER.debugCaught(DebugLogLevel.ERROR, e);
         }
 
         msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_PIN_FROM_ATTR;
@@ -509,7 +514,7 @@
     } catch (SecurityException e) {
       if (debugEnabled())
       {
-        debugCaught(DebugLogLevel.ERROR, e);
+        TRACER.debugCaught(DebugLogLevel.ERROR, e);
       }
 
       int msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_FILE;
@@ -527,7 +532,7 @@
       } catch (KeyStoreException kse) {
         if (debugEnabled())
         {
-          debugCaught(DebugLogLevel.ERROR, kse);
+          TRACER.debugCaught(DebugLogLevel.ERROR, kse);
         }
 
         int msgID = MSGID_FILE_KEYMANAGER_INVALID_TYPE;
@@ -669,7 +674,7 @@
     {
       if (debugEnabled())
       {
-        debugCaught(DebugLogLevel.ERROR, e);
+        TRACER.debugCaught(DebugLogLevel.ERROR, e);
       }
 
       int msgID = MSGID_FILE_KEYMANAGER_CANNOT_LOAD;
@@ -691,7 +696,7 @@
     {
       if (debugEnabled())
       {
-        debugCaught(DebugLogLevel.ERROR, e);
+        TRACER.debugCaught(DebugLogLevel.ERROR, e);
       }
 
       int msgID = MSGID_FILE_KEYMANAGER_CANNOT_CREATE_FACTORY;
@@ -842,7 +847,7 @@
     {
       if (debugEnabled())
       {
-        debugCaught(DebugLogLevel.ERROR, ce);
+        TRACER.debugCaught(DebugLogLevel.ERROR, ce);
       }
 
       unacceptableReasons.add(ce.getMessage());
@@ -852,7 +857,7 @@
     {
       if (debugEnabled())
       {
-        debugCaught(DebugLogLevel.ERROR, e);
+        TRACER.debugCaught(DebugLogLevel.ERROR, e);
       }
 
       msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_FILE;
@@ -886,7 +891,7 @@
         {
           if (debugEnabled())
           {
-            debugCaught(DebugLogLevel.ERROR, kse);
+            TRACER.debugCaught(DebugLogLevel.ERROR, kse);
           }
 
           msgID = MSGID_FILE_KEYMANAGER_INVALID_TYPE;
@@ -902,7 +907,7 @@
     {
       if (debugEnabled())
       {
-        debugCaught(DebugLogLevel.ERROR, e);
+        TRACER.debugCaught(DebugLogLevel.ERROR, e);
       }
 
       msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_TYPE;
@@ -951,7 +956,7 @@
       {
         if (debugEnabled())
         {
-          debugCaught(DebugLogLevel.ERROR, e);
+          TRACER.debugCaught(DebugLogLevel.ERROR, e);
         }
 
         msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_PIN_PROPERTY;
@@ -993,7 +998,7 @@
       {
         if (debugEnabled())
         {
-          debugCaught(DebugLogLevel.ERROR, e);
+          TRACER.debugCaught(DebugLogLevel.ERROR, e);
         }
 
         msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_PIN_ENVAR;
@@ -1065,7 +1070,7 @@
       {
         if (debugEnabled())
         {
-          debugCaught(DebugLogLevel.ERROR, e);
+          TRACER.debugCaught(DebugLogLevel.ERROR, e);
         }
 
         msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_PIN_FILE;
@@ -1094,7 +1099,7 @@
       {
         if (debugEnabled())
         {
-          debugCaught(DebugLogLevel.ERROR, e);
+          TRACER.debugCaught(DebugLogLevel.ERROR, e);
         }
 
         msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_PIN_FROM_ATTR;
@@ -1179,7 +1184,7 @@
     {
       if (debugEnabled())
       {
-        debugCaught(DebugLogLevel.ERROR, ce);
+        TRACER.debugCaught(DebugLogLevel.ERROR, ce);
       }
 
       if (resultCode == ResultCode.SUCCESS)
@@ -1191,7 +1196,7 @@
     {
       if (debugEnabled())
       {
-        debugCaught(DebugLogLevel.ERROR, e);
+        TRACER.debugCaught(DebugLogLevel.ERROR, e);
       }
 
       msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_FILE;
@@ -1229,7 +1234,7 @@
         {
           if (debugEnabled())
           {
-            debugCaught(DebugLogLevel.ERROR, kse);
+            TRACER.debugCaught(DebugLogLevel.ERROR, kse);
           }
 
           msgID = MSGID_FILE_KEYMANAGER_INVALID_TYPE;
@@ -1248,7 +1253,7 @@
     {
       if (debugEnabled())
       {
-        debugCaught(DebugLogLevel.ERROR, e);
+        TRACER.debugCaught(DebugLogLevel.ERROR, e);
       }
 
       msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_TYPE;
@@ -1309,7 +1314,7 @@
       {
         if (debugEnabled())
         {
-          debugCaught(DebugLogLevel.ERROR, e);
+          TRACER.debugCaught(DebugLogLevel.ERROR, e);
         }
 
         msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_PIN_PROPERTY;
@@ -1362,7 +1367,7 @@
       {
         if (debugEnabled())
         {
-          debugCaught(DebugLogLevel.ERROR, e);
+          TRACER.debugCaught(DebugLogLevel.ERROR, e);
         }
 
         msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_PIN_ENVAR;
@@ -1455,7 +1460,7 @@
       {
         if (debugEnabled())
         {
-          debugCaught(DebugLogLevel.ERROR, e);
+          TRACER.debugCaught(DebugLogLevel.ERROR, e);
         }
 
         msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_PIN_FILE;
@@ -1489,7 +1494,7 @@
       {
         if (debugEnabled())
         {
-          debugCaught(DebugLogLevel.ERROR, e);
+          TRACER.debugCaught(DebugLogLevel.ERROR, e);
         }
 
         msgID = MSGID_FILE_KEYMANAGER_CANNOT_DETERMINE_PIN_FROM_ATTR;

--
Gitblit v1.10.0