If the Element is not available anywhere else then the Element itself should form the payload of the notification. An example is a cached web page. This notification strategy is called copy.
Where the cached data is available in a database, there are two choices. Copy as before, or invalidate the data. By invalidating the data, the application tied to the other cache instance will be forced to refresh its cache from the database, preserving cache coherency. Only the Element key needs to be passed over the network.
ehcache supports notification through copy and invalidate, selectable per cache.
ehcache uses a peer replication topology. It adds a twist with CachePeerProvider, an interface which supplies a list of cache instance peers, so as to handle peers entering and leaving the cluster. Some ideas for peer provider implementations are: configuration time list, multicast discovery, application specific cluster list.
ehcache will buffer changes to lower chattiness.
ehcache CachePeerProvider indentifies the local cache instance and excludes it from the notification list. Each Cache has a GUID. That GUID can be compared with list of cache peers and the local peer excluded.
Infinite notifications are prevented by having each CacheReplicatorListener call putQuiet and removeQuite methods on their decorated caches, so as not to nofify listeners.
| Modifier and Type | Interface and Description |
|---|---|
| public interface | CacheManagerPeerListener
A listener for updates, which controls remote cache peers. |
| public interface | CacheManagerPeerProvider
Provides a discovery service to locate |
| public interface | CachePeer
An interface for a cache peer to which updates are made remotely. |
| public interface | CacheReplicator
Replicates cache entries to peers of the CacheManager |
| Modifier and Type | Class and Description |
|---|---|
| public abstract class | CacheManagerPeerListenerFactory
An abstract factory for creating cache manager peer listeners. |
| public abstract class | CacheManagerPeerProviderFactory
An abstract factory for creating peers. |
| public class | ConfigurableRMIClientSocketFactory
Default socket timeouts are unlikely to be suitable for cache replication. |
| public class | EventMessage
An Event Message, in respect of a particular cache. |
| public class | LegacyEventMessage
An Event Message, in respect of a particular cache. |
| public class | ManualRMICacheManagerPeerProvider
A provider of Peer RMI addresses based off manual configuration. |
| public class | MulticastKeepaliveHeartbeatReceiver
Receives heartbeats from any |
| public class | MulticastKeepaliveHeartbeatSender
Sends heartbeats to a multicast group containing a compressed list of URLs. |
| public class | MulticastRMICacheManagerPeerProvider
A peer provider which discovers peers using Multicast. |
| pack-priv class | PayloadUtil
This class provides utility methods for assembling and disassembling a heartbeat payload. |
| public class | RemoteCacheException
A Cache Exception in the distribution mechanism. |
| public class | RMIAsynchronousCacheReplicator
Listens to |
| public class | RMIBootstrapCacheLoader
Loads Elements from a random Cache Peer |
| public class | RMIBootstrapCacheLoaderFactory
A factory to create a configured RMIBootstrapCacheLoader |
| public class | RMICacheManagerPeerListener
A cache server which exposes available cache operations remotely through RMI. |
| public class | RMICacheManagerPeerListenerFactory
Builds a listener based on RMI. |
| public abstract class | RMICacheManagerPeerProvider
A provider of Peer RMI addresses. |
| public class | RMICacheManagerPeerProviderFactory
Builds a factory based on RMI |
| public class | RMICachePeer
An RMI based implementation of |
| public class | RMICacheReplicatorFactory
Creates an RMICacheReplicator using properties. |
| public class | |
| public class | RMISynchronousCacheReplicator
Listens to |
| public class | TransactionalRMICachePeer
An RMI based implementation of |