Class HeartbeatThread
- java.lang.Object
-
- java.lang.Thread
-
- org.opends.server.api.DirectoryThread
-
- org.opends.server.replication.protocol.HeartbeatThread
-
- All Implemented Interfaces:
Runnable
public final class HeartbeatThread extends DirectoryThread
This thread publishes aHeartbeatMsg
on a given protocol session at regular intervals when there are no other replication messages being published.These heartbeat messages are sent by a replication server.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
-
Fields inherited from class org.opends.server.api.DirectoryThread
DIRECTORY_THREAD_GROUP
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description HeartbeatThread(String threadName, Session session, long heartbeatInterval)
Create a heartbeat thread.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
run()
static void
setHeartbeatsDisabled(boolean heartbeatsDisabled)
For testing purposes only to simulate loss of heartbeats.void
shutdown()
Call this method to stop the thread.-
Methods inherited from class org.opends.server.api.DirectoryThread
getAssociatedTask, getDebugProperties, initiateShutdown, isShutdownInitiated, isStarted, isStarting, setAssociatedTask
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
HeartbeatThread
public HeartbeatThread(String threadName, Session session, long heartbeatInterval)
Create a heartbeat thread.- Parameters:
threadName
- The name of the heartbeat thread.session
- The session on which heartbeats are to be sent.heartbeatInterval
- The desired interval between heartbeats in milliseconds.
-
-
Method Detail
-
shutdown
public void shutdown()
Call this method to stop the thread. This method is blocking until the thread has stopped.
-
setHeartbeatsDisabled
public static void setHeartbeatsDisabled(boolean heartbeatsDisabled)
For testing purposes only to simulate loss of heartbeats.- Parameters:
heartbeatsDisabled
- Set true to prevent heartbeats from being sent.
-
-