| java.lang.Object net.sf.ehcache.distribution.RMICacheManagerPeerProvider net.sf.ehcache.distribution.MulticastRMICacheManagerPeerProvider
MulticastRMICacheManagerPeerProvider | final public class MulticastRMICacheManagerPeerProvider extends RMICacheManagerPeerProvider implements CacheManagerPeerProvider(Code) | | A peer provider which discovers peers using Multicast.
Hosts can be in three different levels of conformance with the Multicast specification (RFC1112), according to the requirements they meet.
- Level 0 is the "no support for IP Multicasting" level. Lots of hosts and routers in the Internet are in this state,
as multicast support is not mandatory in IPv4 (it is, however, in IPv6).
Not too much explanation is needed here: hosts in this level can neither send nor receive multicast packets.
They must ignore the ones sent by other multicast capable hosts.
- Level 1 is the "support for sending but not receiving multicast IP datagrams" level.
Thus, note that it is not necessary to join a multicast group to be able to send datagrams to it.
Very few additions are needed in the IP module to make a "Level 0" host "Level 1-compliant".
- Level 2 is the "full support for IP multicasting" level.
Level 2 hosts must be able to both send and receive multicast traffic.
They must know the way to join and leave multicast groups and to propagate this information to multicast routers.
Thus, they must include an Internet Group Management Protocol (IGMP) implementation in their TCP/IP stack.
The list of CachePeers is maintained via heartbeats. rmiUrls are looked up using RMI and converted to CachePeers on
registration. On lookup any stale references are removed.
author: Greg Luck version: $Id: MulticastRMICacheManagerPeerProvider.java 519 2007-07-27 07:11:45Z gregluck $ |
Inner Class :final protected static class CachePeerEntry | |
SHORT_DELAY | final protected static int SHORT_DELAY(Code) | | One second, in ms
|
MulticastRMICacheManagerPeerProvider | public MulticastRMICacheManagerPeerProvider(CacheManager cacheManager, InetAddress groupMulticastAddress, Integer groupMulticastPort, Integer timeToLive)(Code) | | Creates and starts a multicast peer provider
Parameters: groupMulticastAddress - 224.0.0.1 to 239.255.255.255 e.g. 230.0.0.1 Parameters: groupMulticastPort - 1025 to 65536 e.g. 4446 |
dispose | final public void dispose()(Code) | | Shutdown the heartbeat
|
getStaleTime | protected long getStaleTime()(Code) | | The time after which an unrefreshed peer provider entry is considered stale.
|
getTimeForClusterToForm | public long getTimeForClusterToForm()(Code) | | Time for a cluster to form. This varies considerably, depending on the implementation.
the time in ms, for a cluster to form |
registerPeer | final public void registerPeer(String rmiUrl)(Code) | | Register a new peer, but only if the peer is new, otherwise the last seen timestamp is updated.
This method is thread-safe. It relies on peerUrls being a synchronizedMap
Parameters: rmiUrl - |
stale | final protected boolean stale(Date date)(Code) | | Whether the entry should be considered stale.
This will depend on the type of RMICacheManagerPeerProvider.
This method should be overridden for implementations that go stale based on date
Parameters: date - the date the entry was created true if stale |
|
|