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/TraditionalWorkerThread.java |   30 ++++++++++++++++++------------
 1 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/opends/src/server/org/opends/server/extensions/TraditionalWorkerThread.java b/opends/src/server/org/opends/server/extensions/TraditionalWorkerThread.java
index f320e74..4978266 100644
--- a/opends/src/server/org/opends/server/extensions/TraditionalWorkerThread.java
+++ b/opends/src/server/org/opends/server/extensions/TraditionalWorkerThread.java
@@ -40,8 +40,9 @@
 import org.opends.server.types.ErrorLogSeverity;
 import org.opends.server.types.Operation;
 
-import static org.opends.server.loggers.debug.DebugLogger.*;
 import static org.opends.server.loggers.ErrorLogger.*;
+import static org.opends.server.loggers.debug.DebugLogger.*;
+import org.opends.server.loggers.debug.DebugTracer;
 import static org.opends.server.messages.CoreMessages.*;
 import static org.opends.server.messages.MessageHandler.*;
 import static org.opends.server.util.StaticUtils.*;
@@ -54,6 +55,11 @@
 public class TraditionalWorkerThread
        extends DirectoryThread
 {
+  /**
+   * The tracer object for the debug logger.
+   */
+  private static final DebugTracer TRACER = getTracer();
+
   // Indicates whether the Directory Server is shutting down and this thread
   // should stop running.
   private boolean shutdownRequested;
@@ -174,11 +180,11 @@
       {
         if (debugEnabled())
         {
-          debugWarning(
+          TRACER.debugWarning(
             "Uncaught exception in worker thread while processing " +
                 "operation %s: %s", String.valueOf(operation), e);
 
-          debugCaught(DebugLogLevel.ERROR, e);
+          TRACER.debugCaught(DebugLogLevel.ERROR, e);
         }
 
         try
@@ -199,11 +205,11 @@
         {
           if (debugEnabled())
           {
-            debugWarning(
+            TRACER.debugWarning(
               "Exception in worker thread while trying to log a " +
                   "message about an uncaught exception %s: %s", e, e2);
 
-            debugCaught(DebugLogLevel.ERROR, e2);
+            TRACER.debugCaught(DebugLogLevel.ERROR, e2);
           }
         }
 
@@ -222,7 +228,7 @@
         {
           if (debugEnabled())
           {
-            debugCaught(DebugLogLevel.ERROR, e2);
+            TRACER.debugCaught(DebugLogLevel.ERROR, e2);
           }
         }
       }
@@ -245,7 +251,7 @@
 
     if (debugEnabled())
     {
-      debugInfo(getName() + " exiting.");
+      TRACER.debugInfo(getName() + " exiting.");
     }
   }
 
@@ -259,7 +265,7 @@
   {
     if (debugEnabled())
     {
-      debugInfo(getName() + " being signaled to shut down.");
+      TRACER.debugInfo(getName() + " being signaled to shut down.");
     }
 
     // Set a flag that indicates that the thread should stop running.
@@ -278,10 +284,10 @@
       {
         if (debugEnabled())
         {
-          debugWarning(
+          TRACER.debugWarning(
             "Caught an exception while trying to interrupt the worker " +
                 "thread waiting for work: %s", e);
-          debugCaught(DebugLogLevel.ERROR, e);
+          TRACER.debugCaught(DebugLogLevel.ERROR, e);
         }
       }
     }
@@ -297,10 +303,10 @@
       {
         if (debugEnabled())
         {
-          debugWarning(
+          TRACER.debugWarning(
             "Caught an exception while trying to abandon the " +
                 "operation in progress for the worker thread: %s", e);
-          debugCaught(DebugLogLevel.ERROR, e);
+          TRACER.debugCaught(DebugLogLevel.ERROR, e);
         }
       }
     }

--
Gitblit v1.10.0