wt.prefs
Class PrefEntryCache

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

public class PrefEntryCache
extends CacheManager

See Also:
Serialized Form

Field Summary
private  Cache c
           
private static String CLASSNAME
           
private static Object lock
           
private static int prefEntryCacheSize
           
private static boolean VERBOSE
           
private static String versionID
           
 
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
 
Constructor Summary
PrefEntryCache()
          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
 void printCache()
           
 void put(Object key, Object value)
          Put in the local Cache and remove from all other caches
 void putLocalEntry(Object key, Object value)
          Put in the local Cache
 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

versionID

private static final String versionID
See Also:
Constant Field Values

VERBOSE

private static final boolean VERBOSE

CLASSNAME

private static final String CLASSNAME

prefEntryCacheSize

private static int prefEntryCacheSize

lock

private static Object lock

c

private Cache c
Constructor Detail

PrefEntryCache

public PrefEntryCache()
               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

public void putLocalEntry(Object key,
                          Object value)
Put in the local Cache


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

public void printCache()