wt.recent
Class RecentUpdateCache

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

public class RecentUpdateCache
extends CacheManager

See Also:
Serialized Form

Field Summary
private  Cache c
           
private static String CLASSNAME
           
private static RecentlyVisitedServiceFwd fwd
           
private static int recentUpdateCacheSize
           
private 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
RecentUpdateCache()
          Contruct a new cache.
 
Method Summary
 Object get(Object key)
          Get from Local cache else returns null forcing a DB Query
private  Cache getCache()
           
 int getDefaultSize()
          Overriden CacheManager method to set cache size
protected  void printCache()
           
 void put(Object key, Object value)
          Put in the local Cache and remove from all other caches
protected  void putLocalEntry(Object key, Object value)
          Put in the local Cache The params: key : String || value : RecentUpdate object
 void remove(Object key)
          Remove from all caches
protected  void removeEntry(Object key)
          overridden removeEntry method of CacheManager, remove element from local cache
 void reset()
          overridden reset method of CacheManager, clear local cache
 
Methods inherited from class wt.cache.CacheManager
checkAccess, getDefaultName, getEntry, isCacheHost, overflow, ping, putEntry, putEntry, reference, registerSlave, remove, 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

private static final boolean VERBOSE

CLASSNAME

private static final String CLASSNAME

recentUpdateCacheSize

private static int recentUpdateCacheSize

fwd

private static RecentlyVisitedServiceFwd fwd

c

private Cache c
Constructor Detail

RecentUpdateCache

public RecentUpdateCache()
                  throws RemoteException
Contruct a new cache.

Method Detail

getCache

private Cache getCache()

getDefaultSize

public int getDefaultSize()
Overriden CacheManager method to set cache size

Overrides:
getDefaultSize in class CacheManager
Returns:
default cache size

removeEntry

protected void removeEntry(Object key)
overridden removeEntry method of CacheManager, remove element from local cache

Overrides:
removeEntry in class CacheManager
Parameters:
key - - hash key of element to be removed

putLocalEntry

protected void putLocalEntry(Object key,
                             Object value)
Put in the local Cache The params: key : String || value : RecentUpdate object


put

public void put(Object key,
                Object value)
Put in the local Cache and remove from all other caches

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

reset

public void reset()
           throws RemoteException
overridden reset method of CacheManager, clear local cache

Overrides:
reset in class CacheManager
Throws:
RemoteException

remove

public void remove(Object key)
Remove from all caches

Overrides:
remove in class CacheManager
Parameters:
key - the key object (null = clear entire cache)

get

public Object get(Object key)
Get from Local cache else returns null forcing a DB Query

Overrides:
get in class CacheManager
Parameters:
key - the key object
Returns:
the corresponding cached object or null if not in cache

printCache

protected void printCache()