public abstract class RMICacheManagerPeerProvider extends Object implements CacheManagerPeerProvider
Modifier and Type | Field and Description |
---|---|
protected CacheManager |
cacheManager
The CacheManager this peer provider is associated with.
|
protected Map |
peerUrls
Contains a RMI URLs of the form: "//" + hostName + ":" + port + "/" + cacheName;
|
Constructor and Description |
---|
RMICacheManagerPeerProvider()
Empty constructor
|
RMICacheManagerPeerProvider(CacheManager cacheManager)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Providers may be doing all sorts of exotic things and need to be able to clean up on dispose.
|
CacheManager |
getCacheManager()
The cacheManager this provider is bound to
|
String |
getScheme()
The replication scheme.
|
abstract void |
init()
Notifies providers to initialise themselves.
|
abstract List |
listRemoteCachePeers(Ehcache cache) |
CachePeer |
lookupRemoteCachePeer(String url)
The use of one-time registry creation and Naming.rebind should mean we can create as many listeneres as we like.
|
abstract void |
registerPeer(String rmiUrl)
Register a new peer
|
protected abstract boolean |
stale(Date date)
Whether the entry should be considered stale.
|
void |
unregisterPeer(String rmiUrl)
Unregisters a peer
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getTimeForClusterToForm
protected final Map peerUrls
protected CacheManager cacheManager
public RMICacheManagerPeerProvider(CacheManager cacheManager)
cacheManager
- public RMICacheManagerPeerProvider()
public abstract void init()
init
in interface CacheManagerPeerProvider
public abstract void registerPeer(String rmiUrl)
registerPeer
in interface CacheManagerPeerProvider
rmiUrl
- public final void unregisterPeer(String rmiUrl)
unregisterPeer
in interface CacheManagerPeerProvider
rmiUrl
- public abstract List listRemoteCachePeers(Ehcache cache) throws CacheException
listRemoteCachePeers
in interface CacheManagerPeerProvider
CachePeer
peers for the given cache, excluding the local peer.CacheException
protected abstract boolean stale(Date date)
date
- the date the entry was createdpublic CachePeer lookupRemoteCachePeer(String url) throws MalformedURLException, NotBoundException, RemoteException
public void dispose() throws CacheException
dispose
in interface CacheManagerPeerProvider
CacheException
public final CacheManager getCacheManager()
public String getScheme()
CacheReplicator
should lookup
the provider for its scheme type during replication. Similarly a BootstrapCacheLoader
should also look up the provider for its scheme.
getScheme
in interface CacheManagerPeerProvider
Copyright © 2003-2013 Terracotta, Inc.. All Rights Reserved.