Package net.sf.ehcache.distribution
Interface CacheManagerPeerProvider
-
- All Known Subinterfaces:
ManagedCacheManagerPeerProvider
- All Known Implementing Classes:
ManualRMICacheManagerPeerProvider,MulticastRMICacheManagerPeerProvider,RMICacheManagerPeerProvider
public interface CacheManagerPeerProviderProvides a discovery service to locateCachePeerlistener peers for a Cache.- Version:
- $Id$
- Author:
- Greg Luck
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddispose()Providers may be doing all sorts of exotic things and need to be able to clean up on dispose.java.lang.StringgetScheme()The replication scheme.longgetTimeForClusterToForm()Time for a cluster to form.voidinit()Notifies providers to initialise themselves.java.util.ListlistRemoteCachePeers(Ehcache cache)voidregisterPeer(java.lang.String nodeId)Register a new peer.voidunregisterPeer(java.lang.String nodeId)Unregisters a peer.
-
-
-
Method Detail
-
registerPeer
void registerPeer(java.lang.String nodeId)
Register a new peer.- Parameters:
nodeId- Identifies a node in this replication scheme (ex: RMI URL)
-
unregisterPeer
void unregisterPeer(java.lang.String nodeId)
Unregisters a peer.- Parameters:
nodeId- Identifies a node in this replication scheme (ex: RMI URL)
-
listRemoteCachePeers
java.util.List listRemoteCachePeers(Ehcache cache) throws CacheException
- Returns:
- a list of
CachePeerpeers for the given cache, excluding the local peer. - Throws:
CacheException
-
init
void init()
Notifies providers to initialise themselves.- Throws:
CacheException
-
dispose
void dispose() throws CacheExceptionProviders may be doing all sorts of exotic things and need to be able to clean up on dispose.- Throws:
CacheException
-
getTimeForClusterToForm
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
-
getScheme
java.lang.String getScheme()
The replication scheme. Each peer provider has a scheme name, which can be used to specify the scheme for replication and bootstrap purposes. EachCacheReplicatorshould lookup the provider for its scheme type during replication. Similarly aBootstrapCacheLoadershould also look up the provider for its scheme.- Returns:
- the well-known scheme name, which is determined by the replication provider author.
- Since:
- 1.6 introduced to permit multiple distribution schemes to be used in the same CacheManager
-
-