You can control how far the multicast packets propagate by setting the badly misnamed "TTL". Using the multicast IP protocol, the TTL value indicates the scope or range in which a packet may be forwarded. By convention:
| Modifier and Type | Class and Description |
|---|---|
| private class | MulticastKeepaliveHeartbeatSender.MulticastServerThread
A thread which sends a multicast heartbeat every second |
| Modifier and Type | Field and Description |
|---|---|
| private final CacheManager | |
| private static final int | |
| private final InetAddress | |
| private final Integer | |
| private static long | |
| private static long | |
| private InetAddress | |
| private static final Logger | |
| private static final int | |
| private static final int | |
| private static final int | |
| private MulticastKeepaliveHeartbeatSender. | |
| private volatile boolean | |
| private final Integer |
| Access | Constructor and Description |
|---|---|
| public | MulticastKeepaliveHeartbeatSender(CacheManager
the bound CacheManager. Each CacheManager has a maximum of one sender cacheManager, InetAddress multicastAddress, Integer multicastPort, Integer See class description for the meaning of this parameter. timeToLive, InetAddress hostAddress)Constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public final synchronized void | |
| public static long | |
| public static long | |
| public Integer | |
| public final void | |
| public static void | setHeartBeatInterval(long
a time in ms, greater than 1000 heartBeatInterval)Sets the heartbeat interval to something other than the default of 5000ms. |
| public static void | setHeartBeatStaleTime(long
a time in ms heartBeatStaleTime)Sets the heartbeat stale time to something other than the default of |
| cacheManager | back to summary |
|---|---|
| private final CacheManager cacheManager | |
| DEFAULT_HEARTBEAT_INTERVAL | back to summary |
|---|---|
| private static final int DEFAULT_HEARTBEAT_INTERVAL | |
| groupMulticastAddress | back to summary |
|---|---|
| private final InetAddress groupMulticastAddress | |
| groupMulticastPort | back to summary |
|---|---|
| private final Integer groupMulticastPort | |
| heartBeatInterval | back to summary |
|---|---|
| private static long heartBeatInterval | |
| heartBeatStaleTime | back to summary |
|---|---|
| private static long heartBeatStaleTime | |
| hostAddress | back to summary |
|---|---|
| private InetAddress hostAddress | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| MAXIMUM_PEERS_PER_SEND | back to summary |
|---|---|
| private static final int MAXIMUM_PEERS_PER_SEND | |
| MINIMUM_HEARTBEAT_INTERVAL | back to summary |
|---|---|
| private static final int MINIMUM_HEARTBEAT_INTERVAL | |
| ONE_HUNDRED_MS | back to summary |
|---|---|
| private static final int ONE_HUNDRED_MS | |
| serverThread | back to summary |
|---|---|
| private MulticastKeepaliveHeartbeatSender. | |
| stopped | back to summary |
|---|---|
| private volatile boolean stopped | |
| timeToLive | back to summary |
|---|---|
| private final Integer timeToLive | |
| MulticastKeepaliveHeartbeatSender | back to summary |
|---|---|
| public MulticastKeepaliveHeartbeatSender(CacheManager cacheManager, InetAddress multicastAddress, Integer multicastPort, Integer timeToLive, InetAddress hostAddress) Constructor.
| |
| dispose | back to summary |
|---|---|
| public final synchronized void dispose() Shutdown this heartbeat sender | |
| getHeartBeatInterval | back to summary |
|---|---|
| public static long getHeartBeatInterval() Returns the heartbeat interval. | |
| getHeartBeatStaleTime | back to summary |
|---|---|
| public static long getHeartBeatStaleTime() Returns the time after which a heartbeat is considered stale. | |
| getTimeToLive | back to summary |
|---|---|
public Integer getTimeToLive()
| |
| init | back to summary |
|---|---|
| public final void init() Start the heartbeat thread | |
| setHeartBeatInterval | back to summary |
|---|---|
| public static void setHeartBeatInterval(long heartBeatInterval) Sets the heartbeat interval to something other than the default of 5000ms. This is useful for testing, but not recommended for production. This method is static and so affects the heartbeat interval of all senders. The change takes effect after the next scheduled heartbeat.
| |
| setHeartBeatStaleTime | back to summary |
|---|---|
| public static void setHeartBeatStaleTime(long heartBeatStaleTime) Sets the heartbeat stale time to something other than the default of
| |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private List | |
| private MulticastSocket |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private List | |
| public final void | |
| public final void | run()
Overrides java. Implements java. |
| cachePeersHash | back to summary |
|---|---|
| private int cachePeersHash | |
| compressedUrlListList | back to summary |
|---|---|
| private List<E> compressedUrlListList | |
| socket | back to summary |
|---|---|
| private MulticastSocket socket | |
| MulticastServerThread | back to summary |
|---|---|
| public MulticastServerThread() Constructor | |
| closeSocket | back to summary |
|---|---|
| private void closeSocket() | |
| createCachePeersPayload | back to summary |
|---|---|
| private List Creates a gzipped payload. The last gzipped payload is retained and only recalculated if the list of cache peers has changed.
| |
| interrupt | back to summary |
|---|---|
| public final void interrupt() Overrides java. Interrupts this thread.
Unless the current thread is interrupting itself, which is
always permitted, the
If this thread is blocked in an invocation of the
If this thread is blocked in an I/O operation upon an
If this thread is blocked in a
If none of the previous conditions hold then this thread's interrupt status will be set.
| |
| run | back to summary |
|---|---|
| public final void run() Overrides java. Implements java. Doc from java. This method is run by the thread when it executes. Subclasses of This method is not intended to be invoked directly. If this thread is a
platform thread created with a
| |