wt.org
Class WTDirKeyCache

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended bywt.util.RMIServer
              extended bywt.cache.CacheManager
                  extended bywt.org.WTDirKeyCache
All Implemented Interfaces:
CacheServer, Remote, Serializable, Unreferenced

public class WTDirKeyCache
extends CacheManager

See Also:
Serialized Form

Field Summary
protected static boolean STACKTRACE
           
protected static boolean VERBOSE
           
 
Fields inherited from class wt.cache.CacheManager
MASTER
 
Fields inherited from class wt.util.RMIServer
csf, ssf
 
Fields inherited from class java.rmi.server.RemoteServer
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface wt.cache.CacheServer
versionID
 
Constructor Summary
WTDirKeyCache()
           
 
Method Summary
 int getDefaultSize()
          Get desired size of this cache.
 Object getEntry(Object key)
          Remote method for getting a cache entry.
 void putEntry(Object key, Object value)
          Protected method which allows subclasses of CacheManager to take some action when a new entry is being put into the local cache.
 void reset()
          Reset local cache after master reconnect.
 
Methods inherited from class wt.cache.CacheManager
checkAccess, get, getDefaultName, isCacheHost, overflow, ping, put, 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
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

VERBOSE

protected static boolean VERBOSE

STACKTRACE

protected static boolean STACKTRACE
Constructor Detail

WTDirKeyCache

public WTDirKeyCache()
              throws RemoteException
Method Detail

getEntry

public Object getEntry(Object key)
Description copied from class: CacheManager
Remote method for getting a cache entry.

Supported API: false

Specified by:
getEntry in interface CacheServer
Overrides:
getEntry in class CacheManager

putEntry

public void putEntry(Object key,
                     Object value)
Description copied from class: CacheManager
Protected method which allows subclasses of CacheManager to take some action when a new entry is being put into the local cache. This method is invoked to put the entry in the local cache as a result of a local put call or a call forwarded from a slave cache or when a local get call downloads the entry from a master cache. If this cache has a master cache, the put call will already be forwarded to the master before this method is invoked. Slave caches will be notified to remove their entries after this method returns. This method must not cause a recursive put call.

Supported API: true

Overrides:
putEntry in class CacheManager
Parameters:
key - the key object
value - the value object

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

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