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

Matthew Swift
23.27.2011 6ee1440f6f56ac066f97383315b2798287f0821a
opends/src/server/org/opends/server/replication/protocol/HeartbeatMonitor.java
@@ -35,8 +35,6 @@
import org.opends.server.loggers.debug.DebugTracer;
import java.io.IOException;
import org.opends.server.api.DirectoryThread;
/**
@@ -71,27 +69,18 @@
  private volatile boolean shutdown = false;
  /**
   * Send StopMsg before session closure or not.
   */
  private final boolean sendStopBeforeClose;
  /**
   * Create a heartbeat monitor thread.
   * @param threadName The name of the heartbeat thread.
   * @param session The session on which heartbeats are to be monitored.
   * @param heartbeatInterval The expected interval between heartbeats received
   * (in milliseconds).
   * @param sendStopBeforeClose Should we send a StopMsg before closing the
   *        session ?
   */
  public HeartbeatMonitor(String threadName, ProtocolSession session,
                          long heartbeatInterval, boolean sendStopBeforeClose)
                          long heartbeatInterval)
  {
    super(threadName);
    this.session = session;
    this.heartbeatInterval = heartbeatInterval;
    this.sendStopBeforeClose = sendStopBeforeClose;
  }
  /**
@@ -126,18 +115,6 @@
          {
            // Heartbeat is well overdue so the server is assumed to be dead.
            logError(NOTE_HEARTBEAT_FAILURE.get(currentThread().getName()));
            if (sendStopBeforeClose)
            {
              // V4 protocol introduces a StopMsg to properly end communications
              try
              {
                session.publish(new StopMsg());
              }
              catch (IOException ioe)
              {
                // Anyway, going to close session, so nothing to do
              }
            }
            session.close();
            break;
          }
@@ -160,10 +137,6 @@
        }
      }
    }
    catch (IOException e)
    {
      // Hope that's OK.
    }
    finally
    {
      if (debugEnabled())