Package net.sf.ehcache.distribution
Class ManualRMICacheManagerPeerProvider
- java.lang.Object
-
- net.sf.ehcache.distribution.RMICacheManagerPeerProvider
-
- net.sf.ehcache.distribution.ManualRMICacheManagerPeerProvider
-
- All Implemented Interfaces:
CacheManagerPeerProvider
public final class ManualRMICacheManagerPeerProvider extends RMICacheManagerPeerProvider
A provider of Peer RMI addresses based off manual configuration.Because there is no monitoring of whether a peer is actually there, the list of peers is dynamically looked up and verified each time a lookup request is made.
- Version:
- $Id$
- Author:
- Greg Luck
-
-
Field Summary
-
Fields inherited from class net.sf.ehcache.distribution.RMICacheManagerPeerProvider
cacheManager, peerUrls
-
-
Constructor Summary
Constructors Constructor Description ManualRMICacheManagerPeerProvider()Empty constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetTimeForClusterToForm()Time for a cluster to form.voidinit()Notifies providers to initialise themselves.java.util.ListlistRemoteCachePeers(Ehcache cache)voidregisterPeer(java.lang.String rmiUrl)Register a new peer.protected booleanstale(java.util.Date date)Whether the entry should be considered stale.-
Methods inherited from class net.sf.ehcache.distribution.RMICacheManagerPeerProvider
dispose, getCacheManager, getScheme, lookupRemoteCachePeer, unregisterPeer
-
-
-
-
Method Detail
-
init
public final void init()
Notifies providers to initialise themselves.- Specified by:
initin interfaceCacheManagerPeerProvider- Specified by:
initin classRMICacheManagerPeerProvider
-
getTimeForClusterToForm
public long getTimeForClusterToForm()
Time for a cluster to form. This varies considerably, depending on the implementation.- Returns:
- the time in ms, for a cluster to form
-
registerPeer
public final void registerPeer(java.lang.String rmiUrl)
Register a new peer.- Specified by:
registerPeerin interfaceCacheManagerPeerProvider- Specified by:
registerPeerin classRMICacheManagerPeerProvider- Parameters:
rmiUrl-
-
listRemoteCachePeers
public final java.util.List listRemoteCachePeers(Ehcache cache) throws CacheException
- Specified by:
listRemoteCachePeersin interfaceCacheManagerPeerProvider- Specified by:
listRemoteCachePeersin classRMICacheManagerPeerProvider- Returns:
- a list of
CachePeerpeers, excluding the local peer. - Throws:
CacheException
-
stale
protected final boolean stale(java.util.Date date)
Whether the entry should be considered stale.Manual RMICacheManagerProviders use a static list of urls and are therefore never stale.
- Specified by:
stalein classRMICacheManagerPeerProvider- Parameters:
date- the date the entry was created- Returns:
- true if stale
-
-