net.sf.ehcache.distribution

Class MulticastKeepaliveHeartbeatSender

public final class MulticastKeepaliveHeartbeatSender extends Object

Sends heartbeats to a multicast group containing a compressed list of URLs. Supports up to approximately 500 configured caches.

Version: $Id: MulticastKeepaliveHeartbeatSender.java 191 2006-09-03 22:41:48Z gregluck $

Author: Greg Luck

Constructor Summary
MulticastKeepaliveHeartbeatSender(CacheManager cacheManager, InetAddress multicastAddress, Integer multicastPort)
Constructor
Method Summary
voiddispose()
Shutdown this heartbeat sender
static longgetHeartBeatInterval()
Returns the heartbeat interval.
voidinit()
Start the heartbeat thread
static voidsetHeartBeatInterval(long heartBeatInterval)
Sets the heartbeat interval to something other than the default of 5000ms.

Constructor Detail

MulticastKeepaliveHeartbeatSender

public MulticastKeepaliveHeartbeatSender(CacheManager cacheManager, InetAddress multicastAddress, Integer multicastPort)
Constructor

Parameters: multicastAddress multicastPort

Method Detail

dispose

public final void dispose()
Shutdown this heartbeat sender

getHeartBeatInterval

public static long getHeartBeatInterval()
Returns the heartbeat interval.

init

public final void init()
Start the heartbeat thread

setHeartBeatInterval

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.

Parameters: heartBeatInterval a time in ms, greater than 1000