wt.cache
Class MasterCacheMonitor
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
wt.util.RMIServer
wt.cache.CacheManager
wt.cache.MasterCacheMonitor
- All Implemented Interfaces:
- CacheServer, Remote, Runnable, Serializable, Unreferenced
- public class MasterCacheMonitor
- extends CacheManager
- implements Runnable
Special cache manager used to implement remote master monitoring.
This class periodically pings the master cache. It it is ever reset
as a result of connecting to a new master, all registered caches will
also be reset so they will register with the new master in a timely
fashion.
Should be a static public inner class of CacheManager, but JDK compiler
barfs on blank final initializers when CacheManager class contains inner
classes.
Supported API: false
- See Also:
- Serialized Form
Methods inherited from class wt.cache.CacheManager |
checkAccess, get, getDefaultName, getEntry, isCacheHost, overflow, ping, put, putEntry, putEntry, reference, registerSlave, remove, remove, removeEntry, removeEntry, unreferenced, update, updateEntry, updateEntry |
Methods inherited from class wt.util.RMIServer |
clone, exportObject, exportObject, exportObject, getClientSocketFactory, getPort, getServerSocketFactory, getStub, isHostInList, isLocalHost, setPort, writeReplace |
monitor
private static MasterCacheMonitor monitor
cacheManagers
private static Vector cacheManagers
MasterCacheMonitor
public MasterCacheMonitor()
throws RemoteException
getInstance
public static MasterCacheMonitor getInstance()
throws RemoteException
- Throws:
RemoteException
registerCacheManager
void registerCacheManager(CacheManager manager)
throws RemoteException
- Throws:
RemoteException
getDefaultSize
public int getDefaultSize()
- Description copied from class:
CacheManager
- Get desired size of this cache.
This method attemps to find a size property called
wt.cache.size.CacheName
where cacheName
is the name of this cache. Subclasses can override this
method to control cache size in some other way. If no property is found, the default
size is 100.
Supported API: true
- Overrides:
getDefaultSize
in class CacheManager
run
public void run()
- Specified by:
run
in interface Runnable
reset
public void reset()
throws RemoteException
- Description copied from class:
CacheManager
- Reset local cache after master reconnect.
Called after recovery from communication failure when a connection to a
new master has been established. The current cache contents are cleared
and the local cache is registered as a slave of the new master.
NOTE: This may be called as a result of calling other cache updating operations
since that is when the disconnect and reconnect may take place. When this
happens, this method is called before the other methods return.
Supported API: true
- Overrides:
reset
in class CacheManager
- Throws:
RemoteException