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/replication/protocol/HeartbeatThread.java | 24 ++++++++++++++----------
1 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/opends/src/server/org/opends/server/replication/protocol/HeartbeatThread.java b/opends/src/server/org/opends/server/replication/protocol/HeartbeatThread.java
index 651bee5..9723814 100644
--- a/opends/src/server/org/opends/server/replication/protocol/HeartbeatThread.java
+++ b/opends/src/server/org/opends/server/replication/protocol/HeartbeatThread.java
@@ -28,9 +28,8 @@
package org.opends.server.replication.protocol;
import org.opends.server.api.DirectoryThread;
-import static org.opends.server.loggers.debug.DebugLogger.debugEnabled;
-import static org.opends.server.loggers.debug.DebugLogger.debugVerbose;
-import static org.opends.server.loggers.debug.DebugLogger.debugInfo;
+import static org.opends.server.loggers.debug.DebugLogger.*;
+import org.opends.server.loggers.debug.DebugTracer;
import java.io.IOException;
@@ -41,6 +40,11 @@
*/
public class HeartbeatThread extends DirectoryThread
{
+ /**
+ * The tracer object for the debug logger.
+ */
+ private static final DebugTracer TRACER = getTracer();
+
/**
* For test purposes only to simulate loss of heartbeats.
@@ -90,7 +94,7 @@
{
if (debugEnabled())
{
- debugInfo("Heartbeat thread is starting, interval is %d",
+ TRACER.debugInfo("Heartbeat thread is starting, interval is %d",
heartbeatInterval);
}
HeartbeatMessage heartbeatMessage = new HeartbeatMessage();
@@ -100,8 +104,8 @@
long now = System.currentTimeMillis();
if (debugEnabled())
{
- debugVerbose("Heartbeat thread awoke at %d, last message was sent " +
- "at %d", now, session.getLastPublishTime());
+ TRACER.debugVerbose("Heartbeat thread awoke at %d, last message " +
+ "was sent at %d", now, session.getLastPublishTime());
}
if (now > session.getLastPublishTime() + heartbeatInterval)
@@ -110,7 +114,7 @@
{
if (debugEnabled())
{
- debugVerbose("Heartbeat sent at %d", now);
+ TRACER.debugVerbose("Heartbeat sent at %d", now);
}
session.publish(heartbeatMessage);
}
@@ -127,7 +131,7 @@
if (debugEnabled())
{
- debugVerbose("Heartbeat thread sleeping for %d", sleepTime);
+ TRACER.debugVerbose("Heartbeat thread sleeping for %d", sleepTime);
}
Thread.sleep(sleepTime);
}
@@ -141,7 +145,7 @@
{
if (debugEnabled())
{
- debugInfo("Heartbeat thread could not send a heartbeat.");
+ TRACER.debugInfo("Heartbeat thread could not send a heartbeat.");
}
// This will be caught in another thread.
}
@@ -149,7 +153,7 @@
{
if (debugEnabled())
{
- debugInfo("Heartbeat thread is exiting.");
+ TRACER.debugInfo("Heartbeat thread is exiting.");
}
}
}
--
Gitblit v1.10.0