mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

boli
01.27.2007 455897cc245b67d929f409a93cfa7106e835cc1f
opends/src/server/org/opends/server/synchronization/plugin/HeartbeatMonitor.java
@@ -29,10 +29,8 @@
import org.opends.server.api.DirectoryThread;
import org.opends.server.synchronization.protocol.ProtocolSession;
import static org.opends.server.loggers.Debug.debugMessage;
import static org.opends.server.types.DebugLogCategory.SYNCHRONIZATION;
import static org.opends.server.types.DebugLogSeverity.INFO;
import static org.opends.server.loggers.debug.DebugLogger.debugEnabled;
import static org.opends.server.loggers.debug.DebugLogger.debugInfo;
import java.io.IOException;
/**
@@ -41,11 +39,6 @@
 */
public class HeartbeatMonitor extends DirectoryThread
{
  /**
   * The fully-qualified name of this class for debugging purposes.
   */
  private static final String CLASS_NAME =
       "org.opends.server.synchronization.plugin.HeartbeatMonitor";
  /**
@@ -97,9 +90,11 @@
  @Override
  public void run()
  {
    debugMessage(SYNCHRONIZATION, INFO, CLASS_NAME, "run",
                 "Heartbeat monitor is starting, expected interval is "
                      + heartbeatInterval);
    if (debugEnabled())
    {
      debugInfo("Heartbeat monitor is starting, expected interval is %d",
                heartbeatInterval);
    }
    try
    {
      while (!shutdown)
@@ -109,10 +104,11 @@
        if (now > lastReceiveTime + 2 * heartbeatInterval)
        {
          // Heartbeat is well overdue so the server is assumed to be dead.
          debugMessage(SYNCHRONIZATION, INFO, CLASS_NAME, "run",
                       "Heartbeat monitor is closing the broker " +
                            "session because it could not detect a " +
                            "heartbeat.");
          if (debugEnabled())
          {
            debugInfo("Heartbeat monitor is closing the broker session " +
                "because it could not detect a heartbeat.");
          }
          session.close();
          break;
        }
@@ -132,8 +128,10 @@
    }
    finally
    {
      debugMessage(SYNCHRONIZATION, INFO, CLASS_NAME, "run",
                   "Heartbeat monitor is exiting.");
      if (debugEnabled())
      {
        debugInfo("Heartbeat monitor is exiting.");
      }
    }
  }
}