|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ehcache.distribution.MulticastKeepaliveHeartbeatSender
public final class MulticastKeepaliveHeartbeatSender
Sends heartbeats to a multicast group containing a compressed list of URLs.
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:
Constructor Summary | |
---|---|
MulticastKeepaliveHeartbeatSender(CacheManager cacheManager,
InetAddress multicastAddress,
Integer multicastPort,
Integer timeToLive,
InetAddress hostAddress)
Constructor. |
Method Summary | |
---|---|
void |
dispose()
Shutdown this heartbeat sender |
static long |
getHeartBeatInterval()
Returns the heartbeat interval. |
static long |
getHeartBeatStaleTime()
Returns the time after which a heartbeat is considered stale. |
Integer |
getTimeToLive()
|
void |
init()
Start the heartbeat thread |
static void |
setHeartBeatInterval(long heartBeatInterval)
Sets the heartbeat interval to something other than the default of 5000ms. |
static void |
setHeartBeatStaleTime(long heartBeatStaleTime)
Sets the heartbeat stale time to something other than the default of ((2 * HeartBeatInterval) + 100)ms . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MulticastKeepaliveHeartbeatSender(CacheManager cacheManager, InetAddress multicastAddress, Integer multicastPort, Integer timeToLive, InetAddress hostAddress)
cacheManager
- the bound CacheManager. Each CacheManager has a maximum of one sendermulticastAddress
- multicastPort
- timeToLive
- See class description for the meaning of this parameter.Method Detail |
---|
public final void init()
public final void dispose()
public static void setHeartBeatInterval(long heartBeatInterval)
heartBeatInterval
- a time in ms, greater than 1000public static void setHeartBeatStaleTime(long heartBeatStaleTime)
((2 * HeartBeatInterval) + 100)ms
.
This is useful for testing, but not recommended for production. This method is static and so affects the stale
time all users.
heartBeatStaleTime
- a time in mspublic static long getHeartBeatInterval()
public static long getHeartBeatStaleTime()
public Integer getTimeToLive()
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |